go ahead... be a heretic | |
PerlMonks |
Re: Store regular expressions in a file.by cdarke (Prior) |
on Nov 11, 2010 at 10:58 UTC ( [id://870813]=note: print w/replies, xml ) | Need Help?? |
this 'data' is a regular expression No, it is not a regular expression, only the duck is a regular expression. s is a Perl operator. If you can it would be a lot easier to have two columns, the first being the RE pattern ('duck') and the second being the replacement text ('luck') and then read them into variables (using split) - it is perfectly valid (and common) to store an RE in a Perl variable. Otherwise you will be reduced to doing nasty things like eval, and you don't want to go there.
In Section
Seekers of Perl Wisdom
|
|