Aspect...ntarray(3pm)

πŸ“¦
version 1.04 Β· 3 versions
, in debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

✨ NAME ✨

Aspect::Pointcut::Wantarray β€” bestie, it's a pointcut for the run-time wantarray context πŸ’… (yes, the vibe check happens at runtime, iconic)


🌸 SYNOPSIS 🌸

use Aspect;

# High-level creation
my $pointcut1 = wantlist | wantscalar | wantvoid;

# Manual creation
my $pointcut2 = Padre::Pointcut::Or->new(
  Padre::Pointcut::Wantarray->new( 1 ),     # List
  Padre::Pointcut::Wantarray->new( 0 ),     # Scalar
  Padre::Pointcut::Wantarray->new( undef ), # Void
);

okay so literally two ways to do it: the easy high-level glow-up, or the manual hand-crafted artisanal build πŸŽ€ and note that 1 is List, 0 is Scalar, and undef is Void β€” no cap, that's the whole mapping, don't get it twisted πŸ™ˆ


πŸ¦‹ DESCRIPTION πŸ¦‹

The Aspect::Pointcut::Wantarray pointcut lets you create aspects that only trap calls made in a particular calling context β€” and the contexts on the menu are list, scalar, or void. that's it, that's the serve ✨

like… it's giving "I only care about you when you're in scalar context" energy, and honestly? valid πŸ’–


πŸ‘‘ AUTHORS πŸ‘‘

Adam Kennedy <adamk@cpan.org> β€” the one and only, main character energy fr fr 🫢


Copyright 2001 by Marcel Grünauer 🌸

Some parts copyright 2009 - 2013 Adam Kennedy ⭐

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. periodt πŸ’…


and that's the whole page, bestie β€” you got this πŸ’– this lil beauty is from the Perl user-contributed docs, perl v5.36.0, dated 2023-07-02, filed under Aspect...ntarray(3pm). now go write some pointcuts and slay βœ¨πŸ¦‹πŸŽ€

πŸ“¦ where this page comes from