print "Match 1\n" if "teststring" =~ ""; print "Match 2\n" if "teststring" =~ undef; __OUTPUT__ Match 1 Match 2