]> git.vpit.fr Git - perl/modules/Scope-Upper.git/blobdiff - lib/Scope/Upper.pm
Show non-reachable locations in unwind() examples
[perl/modules/Scope-Upper.git] / lib / Scope / Upper.pm
index 1570300323addcc83a51eff22d463d3ee7496f42..0de64ff6e5dae70f673a9584c5d74ada9a2dbc25 100644 (file)
@@ -9,13 +9,13 @@ Scope::Upper - Act on upper scopes.
 
 =head1 VERSION
 
-Version 0.06
+Version 0.07
 
 =cut
 
 our $VERSION;
 BEGIN {
- $VERSION = '0.06';
+ $VERSION = '0.07';
 }
 
 =head1 SYNOPSIS
@@ -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>.
@@ -231,10 +235,12 @@ The context of the scope just above C<$from>.
 =head3 C<SUB $from>
 
 The context of the closest subroutine above C<$from>.
+Note that C<$from> is returned if it is already a subroutine context ; hence C<SUB SUB == SUB>.
 
 =head3 C<EVAL $from>
 
 The context of the closest eval above C<$from>.
+Note that C<$from> is returned if it is already an eval context ; hence C<EVAL EVAL == EVAL>.
 
 =head2 Getting a context from a level