Help for this page

Select Code to Download


  1. or download this
    my $t = "cat hat bat mat";
    print pos($t), "\n"; # -> (empty)
    ...
    $t =~ m/at/g; print pos($t), "\n"; # -> 11
    $t =~ m/hat/g; print pos($t), "\n"; # -> (empty)
    $t =~ m/at/g; print pos($t), "\n"; # -> 3