The solution I provided solves the problem you describe here. It matches on word boundaries, it does not require the entire string to match. My solution did not include strict, warnings, or Carp, but strict and warnings are pragmas, and do not require external modules. Warnings is not supported in some versions of Perl, so you should rely on the -w option, in that case.