X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=lib%2FScope%2FUpper.pm;h=2ca1a2d64292e94031abad18b3fde8f184dcda46;hb=47d05ad590cff62def1004f1eb061932ac460668;hp=ac97d57cd360c8d38ec77ec8436b9c2697521d17;hpb=da37c6765511d43f6a7915bc65d6b80e8f2d9217;p=perl%2Fmodules%2FScope-Upper.git diff --git a/lib/Scope/Upper.pm b/lib/Scope/Upper.pm index ac97d57..2ca1a2d 100644 --- a/lib/Scope/Upper.pm +++ b/lib/Scope/Upper.pm @@ -9,13 +9,13 @@ Scope::Upper - Act on upper scopes. =head1 VERSION -Version 0.18 +Version 0.19 =cut our $VERSION; BEGIN { - $VERSION = '0.18'; + $VERSION = '0.19'; } =head1 SYNOPSIS @@ -270,7 +270,10 @@ C<$key> is either an array index or a hash key, depending of which kind of varia If C<$what> is a string pointing to an undeclared variable, the variable will be vivified as soon as the localization occurs and emptied when it ends, although it will still exist in its glob. -=head2 C +=head2 C + + localize_delete $what, $key; + localize_delete $what, $key, $context; Introduces the deletion of a variable or an array/hash element delayed to the time of first return into the upper scope denoted by C<$context>. C<$what> can be: @@ -329,14 +332,14 @@ The previous example can then be "corrected" : will rightfully set C<$num> to C<26>. -=head2 C +=head2 C my @ret = uplevel { ...; return @ret }; my @ret = uplevel { my @args = @_; ...; return @ret } @args; my @ret = uplevel { ... } @args, $context; my @ret = &uplevel($callback, @args, $context); -Executes the code reference C<$code> with arguments C<@args> as if it were located at the subroutine stack frame pointed by C<$context>, effectively fooling C and C into believing that the call actually happened higher in the stack. +Executes the code reference C<$callback> with arguments C<@args> as if it were located at the subroutine stack frame pointed by C<$context>, effectively fooling C and C into believing that the call actually happened higher in the stack. The code is executed in the context of the C call, and what it returns is returned as-is by C. sub target { @@ -729,7 +732,7 @@ Thanks to Shawn M. Moore for motivation. =head1 COPYRIGHT & LICENSE -Copyright 2008,2009,2010,2011 Vincent Pit, all rights reserved. +Copyright 2008,2009,2010,2011,2012 Vincent Pit, all rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.