$m; die "No matches" if !grep { /(foo|bar)/; $m="$1 in $_" } qw(zip, zoom, zfoobarfuzz); print "found: $m" # found: foo in zfoobarfuzz # This is perl, v5.8.8 built for i686-linux