- or download this
my $index2 = -1;
foreach (1 .. 3) {
$index2 = index($body, "c", $index2 + 1);
die "No third 'c'" if $index2 < 0;
}
- or download this
$body =~ /a/g or die "No first 'a'";
my $index1 = pos($body);
# my $index1 = index($body, 'a') + length('a');
- or download this
my $inbetween = substr($body, $index1, $index2 - $index1);