in reply to is this a regexp question ?

Your question is a bit unclear. How do you determine whether a given part of the string is equivalent to "H"?

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"; }