Adam Kennedy > Aspect-1.02 > Aspect::Pointcut::True

Download:
Aspect-1.02.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  2
Open  1
View/Report Bugs
Module Version: 1.02   Source   Latest Release: Aspect-1.04

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 }
  );

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.

AUTHORS ^

Adam Kennedy <adamk@cpan.org>

Marcel Grünauer <marcel@cpan.org>

Ran Eilam <eilara@cpan.org>

COPYRIGHT ^

Copyright 2001 by Marcel Grünauer

Some parts copyright 2009 - 2012 Adam Kennedy.

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

syntax highlighting: