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") { .. }
[download]
Or you could use a
qr
construct. See
man perlop
for details.
Comment on
Re: How to pass regular expression as variable ?
Select
or
Download
Code
In Section
Seekers of Perl Wisdom