in reply to How to pass regular expression as variable ?

You can use pass around strings: if you use them as a pattern, it will be a pattern (in that sense, regular expressions aren't different from numbers or strings). This is legal:
if ($var =~ "pattern") { .. }
Or you could use a qr construct. See man perlop for details.