local $_ = 'The dog is black cat is white and the fox does not like the cow or pig'; print "match found\n" if /dog/ || /cow/ || /pig/; # or by explicitly stating print "match found\n" if $text =~ /dog/ || $text =~ /cow/ || $text =~ /pig/;