in reply to is this a regexp question ?
This may be something like what you want:
$thisstring = "abjdkwosyksljadfkjadfaduifalkdjfaslflksdf"; sub H { return qr/abjdk|adfkj/; } if ($thisstring =~ H) { print "Yes!\n"; } else { print "No.\n"; } [download]