8 use Scope::Upper qw<unwind want_at :words>;
11 my @result = shift->();
12 my $cx = SUB UP; # Point to the sub above this one
13 unwind +(want_at($cx) ? @result : scalar @result) => $cx;
18 my @things = qw<a b c>;
19 return @things; # returns to try() and then outside zap()
21 print "NOT REACHED\n";
24 my @stuff = zap(); # @stuff contains qw<a b c>
25 my $stuff = zap(); # $stuff contains 3
27 print "zap() returns @stuff in list context and $stuff in scalar context\n";
32 use Scope::Upper qw<uplevel CALLER>;
40 my $sub = (caller 0)[3];
41 print "$_[0] from $sub()\n";
45 target('hello'); # "hello from Uplevel::target()"