$_ = "abcdmefg"; $_ = /m/; print "$&\t$`\t$'\n"; #### It prints: m abcd efg #### $_ = "abcdmefg"; while(m/m/g) { print "matched 'm' at ",pos,"\n"; }