]> git.vpit.fr Git - perl/modules/Scope-Upper.git/blobdiff - samples/tag.pl
Replace raw level numbers by words, except in t/55-unwind-multi.t
[perl/modules/Scope-Upper.git] / samples / tag.pl
index 03a2fbed8d1a791d28adb9924d561dcec3f87060..0e2e63279d56f1250a68e7976d3cbfc8ef26d9da 100644 (file)
@@ -7,7 +7,7 @@ use warnings;
 
 use blib;
 
-use Scope::Upper qw/reap localize localize_elem localize_delete/;
+use Scope::Upper qw/reap localize localize_elem localize_delete UP/;
 
 sub desc { shift->{desc} }
 
@@ -15,21 +15,21 @@ sub set_tag {
  my ($desc) = @_;
 
  # First localize $x so that it gets destroyed last
- localize '$x' => bless({ desc => $desc }, __PACKAGE__) => 1;
+ localize '$x' => bless({ desc => $desc }, __PACKAGE__) => UP;
 
  reap sub {
   my $pkg = caller;
   my $x = do { no strict 'refs'; ${$pkg.'::x'} }; # Get the $x in the scope
   print $x->desc . ": done\n";
- } => 1;
+ } => UP;
 
  localize_elem '%SIG', '__WARN__' => sub {
   my $pkg = caller;
   my $x = do { no strict 'refs'; ${$pkg.'::x'} }; # Get the $x in the scope
   CORE::warn($x->desc . ': ' . join('', @_));
- } => 1;
+ } => UP;
 
- localize_delete '@ARGV', $#ARGV => 1; # delete last @ARGV element
+ localize_delete '@ARGV', $#ARGV => UP; # delete last @ARGV element
 }
 
 package main;