Scope::OnExit - DEPRECATED Running code on scope exit
version 0.03
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.
Note that Feature::Compat::Defer provides a much better way to do this. Unless you need compatibility with perls older than 5.14, I highly recommend using that instead.
This will make the block run at scope exit.
Leon Timmermans <fawaka@gmail.com>
This software is copyright (c) 2009 by Leon Timmermans.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system 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.