in reply to is this a regexp question ?

I'm afraid I don't understand your question. But, as usual, that won't stop me <g>!

You can factor out bits of a regular expression, and pre-compile them using the qr() operator:

my $H = qr{abjdk|adfkj}; if ($thisstring =~ $H) { # do stuff }

If this isn't what you mean, please clarify.