Help for this page

Select Code to Download


  1. or download this
    $ perl -e '$n=3; print "$n: "; for (my $i=0; $i<$n; $i++) { print $i,"
    + "} print "\n"'
    3: 0 1 2
    
    $ perl -e '$n=3.14; print "$n: "; for (my $i=0; $i<$n; $i++) { print $
    +i," "} print "\n"'
    3.14: 0 1 2 3
    
  2. or download this
       Because each operand is evaluated in integer form, "2.18 .. 3.14" w
    +ill
       return two elements in list context.
    
          @list = (2.18 .. 3.14); # same as @list = (2 .. 3);