| Aspect documentation | Contained in the Aspect distribution. |
Aspect::Pointcut::Returning - Function returning without exception
use Aspect;
# Don't trap Foo::Exception object exceptions
after {
$_->return_value(1)
} call 'Foo::bar' & returning;
The Aspect::Pointcut::Returning pointcut is used to match situations
in which after advice should NOT run when the function is throwing an
exception.
Adam Kennedy <adamk@cpan.org>
Copyright 2009 - 2011 Adam Kennedy.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
| Aspect documentation | Contained in the Aspect distribution. |
package Aspect::Pointcut::Returning; use strict; use warnings; use Carp (); use Aspect::Pointcut (); our $VERSION = '1.01'; our @ISA = 'Aspect::Pointcut'; ###################################################################### # Weaving Methods # Exception pointcuts always match at weave time and should curry away sub curry_weave { return; } # Exception-related pointcuts do not curry. sub curry_runtime { return $_[0]; } sub compile_runtime { 'defined $Aspect::POINT->{exception} and not ref $Aspect::POINT->{exception} and $Aspect::POINT->{exception} eq ""'; } 1; __END__