X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=samples%2Ftag.pl;h=03a2fbed8d1a791d28adb9924d561dcec3f87060;hb=3ed219c71c41746b0a59a6217f8fbb3178b36edc;hp=9020121a1ce6143eb3b3e6d6b775d1fd14599550;hpb=44bf1ddcf3a97b602ae2c3ff267375989e5a4dfd;p=perl%2Fmodules%2FScope-Upper.git diff --git a/samples/tag.pl b/samples/tag.pl index 9020121..03a2fbe 100644 --- a/samples/tag.pl +++ b/samples/tag.pl @@ -7,7 +7,7 @@ use warnings; use blib; -use Scope::Upper qw/reap localize localize_elem/; +use Scope::Upper qw/reap localize localize_elem localize_delete/; sub desc { shift->{desc} } @@ -28,6 +28,8 @@ sub set_tag { my $x = do { no strict 'refs'; ${$pkg.'::x'} }; # Get the $x in the scope CORE::warn($x->desc . ': ' . join('', @_)); } => 1; + + localize_delete '@ARGV', $#ARGV => 1; # delete last @ARGV element } package main; @@ -37,6 +39,6 @@ use warnings; { X::set_tag('pie'); - # $x is now a X object - warn 'what'; # warns "pie: what" + # $x is now a X object, and @ARGV has one element less + warn 'what'; # warns "pie: what at ..." } # "pie: done" is printed