debian man page for aspect::advice::after

Query: aspect::advice::after

OS: debian

Section: 3pm

Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar

Aspect::Advice::After(3pm)				User Contributed Perl Documentation				Aspect::Advice::After(3pm)

NAME
Aspect::Advice::After - Execute code after a function is called
SYNOPSIS
use Aspect; after { # Trace all returning calls to your module print STDERR "Called my function " . $_->sub_name . " "; # Suppress exceptions AND alter the results to foo() if ( $_->short_name eq 'foo' ) { if ( $_->exception ) { $_->return_value(1); } else { $_->return_value( $_->return_value + 1 ); } } } call qr/^ MyModule::w+ $/
DESCRIPTION
The "after" advice type is used to execute code after a function is called, regardless of whether or not the function returned normally or threw an exception. The "after" advice type should be used when you need to potentially make multiple different changes to the returned value or the thrown exception. If you only care about normally returned values you should use "returning" in the pointcut to exclude join points occuring due to exceptions. If you only care about handling exceptions you should use "throwing" in the pointcut to exclude join points occuring due to normal return.
AUTHORS
Adam Kennedy <adamk@cpan.org>
COPYRIGHT AND LICENSE
Copyright 2010 Adam Kennedy. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.14.2 2012-02-01 Aspect::Advice::After(3pm)
Related Man Pages
aspect::advice(3pm) - debian
aspect::advice::around(3pm) - debian
aspect::point::functions(3pm) - debian
aspect::pointcut(3pm) - debian
ppi::document::fragment(3pm) - debian
Similar Topics in the Unix Linux Community
Career Advice Asked
Need to build a quick FTP server, Advice??
Advice on why Core file is not being created
AIX Hardware Migration w/ HACMP...Advice Needed
Advice on how to set up error handling