in reply to regex start of word (\<)

I can't tell you with absolute certainty that Perl regexen don't use \< and \> (even though some others do, according to Friedl, Master Regular Expressions, p131) but if you substitute \b -- which Perl does recognize, your script works.
#!/usr/bin/perl use strict; use warnings; #885479 my $string = " cat mat rat pat\n"; if ($string =~ /\bcat/) { print "yes\n"; } else { print "no\n"; }

Note also the omission of your exit 0; and substitution of use warnings (scoped to the current script whereas  - w may kick out warnings about any modules you might use in some more complex program.

However, for future posts, please enclose code (and data) in <c>...</c> tags. See Markup in the Monastery.

Updated with MRE citation.