Help for this page

Select Code to Download


  1. or download this
    for my $i (0..length($string)-1) {
        # whatever with substr($string, $i, 1)
    }
    
  2. or download this
    while ($string =~ /./gs) {
        # whatever with $&
        # note that this incurs the penalty for using $&
    }