Help for this page

Select Code to Download


  1. or download this
      1   for ( 1 .. 3 ) {
      2     my $x = $_;
      3   }
      4   print $x;
    
  2. or download this
      1   my $x = $_ for ( 1 .. 3 );
      2   print $x;
    
  3. or download this
      1   my $x;
      2   $x = $_ for ( 1 .. 3 );
      3   print $x;
    
  4. or download this
      1   do { my $x = $_ } for ( 1 .. 3 );
      2   print $x;
    
  5. or download this
      1   my $x = 6;
      2   my $x = $_ for ( 1 .. 3 );
      3   print $x;