my @WORDS = ("trying", "helping", "doing", "whelp"); my $SEARCH = "help"; my @result = grep {/^\Q$SEARCH\E/} @WORDS; print "$_\n" for @result;