Scope::OnExit - Running code on scope exit
Version 0.02
Execute code on scope exit
use Scope::OnExit; { my $var = foo(); on_scope_exit { do_something($var) }; something_else(); } # scope exit, do_something($var) is run now.
This will make the block run at scope exit.
Leon Timmermans, <leont at cpan.org>
<leont at cpan.org>
Please report any bugs or feature requests to bug-scope-onexit at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Scope-OnExit. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-scope-onexit at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc Scope::OnExit
You can also look for information at:
RT: CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Scope-OnExit
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/Scope-OnExit
CPAN Ratings
http://cpanratings.perl.org/d/Scope-OnExit
Search CPAN
http://search.cpan.org/dist/Scope-OnExit
Copyright 2009 Leon Timmermans, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Scope::OnExit, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Scope::OnExit
CPAN shell
perl -MCPAN -e shell install Scope::OnExit
For more information on module installation, please visit the detailed CPAN module installation guide.