Help for this page

Select Code to Download


  1. or download this
    while ($str =~ s/\A(foo)//) {
      push @got, $1;
    }
    die "unexpected stuff in string: $str" if $str ne '';
    
  2. or download this
    @got = $str =~ m/(foo)/g;