in reply to How do I match a string that is NOT at the end of a line?

Perhaps it is sufficient to just add the  . metacharacter at the end of your pattern:
$ perl -e ' print "matched" if "perlmonk" =~ /monk./;' ~ $ perl -e ' print "matched" if "perlmonks" =~ /monk./;' matched
Update: I had not seen that hippo has already suggested this solution. Sorry for duplicating it.