Help for this page

Select Code to Download


  1. or download this
    print "In main scope $_\n" for 1..10;
    for (1..10) {
      print "In scoped block:$_\n";
    }
    
  2. or download this
    D:\Development>copy con deparse.pl
    use strict;
    ...
    Execution of deparse.out.pl aborted due to compilation errors.
    
    D:\Development>
    
  3. or download this
    D:\Development>perl -MO=Deparse -e "use strict; my $x=1; my $y=1 if $x
    +; print $x.' '.$y;"
    my $x = 1;
    ...
    my $y = $_ while $x--;
    print $x . ' ' . $y;
    -e syntax OK
    
  4. or download this
    D:\Development>perl -MO=Deparse -e "use strict; my $x=1 for 1; print $
    +x"
    foreach $_ (1) {
    ...
    
    D:\Development>perl -e "use strict; my $x=1 for 1; print $x"