Think about Loose Coupling | |
PerlMonks |
Using a regex saved in an environment variableby J0ax88 (Initiate) |
on May 03, 2012 at 02:03 UTC ( [id://968605]=perlquestion: print w/replies, xml ) | Need Help?? |
J0ax88 has asked for the wisdom of the Perl Monks concerning the following question: I want to use a regular expression stored in an environment variable. I have this one-liner that works fine without using an environment variable:
file.txt contains:
The above one-liner prints out what I want:
Now I want to do the same thing except put the regular expression in an environment variable:
So I tried doing this:
and also this:
But it always prints out the whole file. Any help would be appreciated.
Back to
Seekers of Perl Wisdom
|
|