X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=samples%2Ftry.pl;h=7e1cb2a7d3019c91881b40ec0add369a4f773512;hb=bbbe07a5dec59669ffef59ce33e3884ecfd1b7f1;hp=d49c18345b1b308d46241670df4d2c0714a460e5;hpb=086bb57f3e5a02fc333105c08b3ce99318f94fe6;p=perl%2Fmodules%2FScope-Upper.git diff --git a/samples/try.pl b/samples/try.pl index d49c183..7e1cb2a 100644 --- a/samples/try.pl +++ b/samples/try.pl @@ -9,7 +9,7 @@ use Scope::Upper qw/unwind want_at :words/; sub try (&) { my @result = shift->(); - my $cx = SUB UP SUB; + my $cx = SUB UP; # Point to the sub above this one unwind +(want_at($cx) ? @result : scalar @result) => $cx; } @@ -21,7 +21,7 @@ sub zap { print "NOT REACHED\n"; } -my @what = zap(); # @what contains @things -my $what = zap(); # @what contains @things +my @stuff = zap(); # @stuff contains qw/a b c/ +my $stuff = zap(); # $stuff contains 3 -print "zap() returns @what in list context and $what in scalar context\n"; +print "zap() returns @stuff in list context and $stuff in scalar context\n";