print "pos is ", pos, ", remainder '", substr($_, pos), "'\n"; pos($_) = undef; #### Number of occurences = 1 pos is 7, remainder ' twinkle little star' Found 2 times #### my $count =()= m/twinkle/ig;