Help for this page

Select Code to Download


  1. or download this
    my $i;
    for $i ( 0 .. 10 ) {
    ...
        ...
    }
    my $x = substr $somestring, 0, $i;
    
  2. or download this
    my $i=0;
    {
    ...
        redo;
    }
    my $x = substr $somestring, 0, $i;
    
  3. or download this
    $i=0; 
    do{ 
    ...
        $i++ 
    } until <somecondition>;
    my $x = substr $somestring, 0, $i;
    
  4. or download this
    my $i=42; 
    for my $i (1..10){ 
    ...
    print $i;
    ## gives
    1 2 3 4 5 6 7 8 9 10 42