Help for this page

Select Code to Download


  1. or download this
    $ perl -wMstrict -le 'my $x="A"; do { print $x; my $x="B";
      print $x }; print $x'
    ...
    $ perl -wMstrict -le 'do { my $x="A" }; print $x'
    Global symbol "$x" requires explicit package name (did you forget to d
    +eclare "my $x"?) at -e line 1.
    Execution of -e aborted due to compilation errors.
    
  2. or download this
    $ perl -wMstrict -le 'sub Foo::DESTROY {print "BLAM"}; print "A";
      do { my $x = bless {}, "Foo" }; print "B"'
    ...
    A
    BLAM
    B