Deprecated.
The maintainer of this distribution has indicated that it is deprecated and no longer suitable for use.
NAME
Scope::OnExit - DEPRECATED Running code on scope exit
VERSION
version 0.03
SYNOPSIS
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.
FUNCTIONS
on_scope_exit { block }
This will make the block run at scope exit.
AUTHOR
Leon Timmermans <fawaka@gmail.com>
COPYRIGHT AND LICENSE
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.