- or download this
while ($s =~ /abc/g) {
print "found abc at $-[0]\n";
}
- or download this
while ($s =~ /aa/g) {
print "found aa at $-[0]\n";
}
- or download this
found aa at 1
found aa at 3
- or download this
while ($s =~ /aa/g) {
print "found aa at $-[0]\n";
pos($s) = $-[0] + 1;
}