sub Match{foreach (@keys) {return 1 if exists $hash{$_};}return 0} if ( Match ) { print "yep\n"; } else { print "nope\n"; };