From: Vincent Pit Date: Sun, 8 Mar 2009 15:56:36 +0000 (+0100) Subject: Show non-reachable locations in unwind() examples X-Git-Tag: rt44204~3 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=5d1ba2b5e95b62d8afc07902b5d199151048d70f;hp=cd6c4556ac24d07bb96ec65c3c3d5cdfa1850219;p=perl%2Fmodules%2FScope-Upper.git Show non-reachable locations in unwind() examples --- diff --git a/lib/Scope/Upper.pm b/lib/Scope/Upper.pm index 3b80116..0de64ff 100644 --- a/lib/Scope/Upper.pm +++ b/lib/Scope/Upper.pm @@ -72,7 +72,9 @@ BEGIN { sub zap { try { return @things; # returns to try() and then outside zap() + # not reached } + # not reached } my @what = zap(); # @what contains @things @@ -189,6 +191,7 @@ This means that my $num = sub { my @a = ('a' .. 'z'); unwind @a => HERE; + # not reached }->(); will set C<$num> to C<'z'>. @@ -203,6 +206,7 @@ The previous example can then be "corrected" : my $num = sub { my @a = ('a' .. 'z'); unwind +(want_at(HERE) ? @a : scalar @a) => HERE; + # not reached }->(); will righteously set C<$num> to C<26>.