in reply to Re: positions of all occurrences of a substring in a string
in thread positions of all occurrences of a substring in a string

my @poss; my $pos = -1; while (($pos = index($string, $char, $pos + 1)) != -1) { push @poss, $pos; }