logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

Aspect::Pointcut::True - Pointcut that allows arbitrary Perl code

Authors

       Adam Kennedy <adamk@cpan.org>

       Marcel Grünauer <marcel@cpan.org>

       Ran Eilam <eilara@cpan.org>

Description

       Because Aspect's weaving phase technically occurs at run-time (relative to the overall process) it does
       not need to be limit itself only to conditions that are fully describable at compile-time.

       Aspect::Pointcut::True allows you to take advantage of this to create your own custom run-time pointcut
       conditions, although for safety and purity reasons you are not permitted to create custom conditions that
       interact with the Aspect::Point object for the call.

Name

       Aspect::Pointcut::True - Pointcut that allows arbitrary Perl code

Synopsis

         use Aspect;

         # High-level creation
         my $pointcut1 = true { rand() > 0.5 };

         # Manual creation
         my $pointcut2 = Aspect::Pointcut::True->new(
           sub { rand() > 0.5 }
         );

See Also