Think about Loose Coupling | |
PerlMonks |
Applying a RegEx in a variableby ChOas (Curate) |
on Aug 10, 2001 at 11:59 UTC ( [id://103786]=perlquestion: print w/replies, xml ) | Need Help?? |
ChOas has asked for the wisdom of the Perl Monks concerning the following question:
Fellow Celebates, This should be simple, and I`m sure it CAN be done...Sad enough I`m also sure that I haven`t been able to do it yet...... I want to apply a RegEx to a variable .. easy... BUT the RegEx resides in a scalar... Vars: Code1: prints: Match: A Pre: 1234 Post: 4321 Good.. I had expected that... Code2..n: prints: Match: none Pre: none Post: none Match: none Pre: none Post: none Match: none Pre: none Post: none Match: none Pre: none Post: none This is frustrating.. I`m just looking for code X (be it in an eval, or not, I don`t care) that prints Match: A Pre: 1234 Post: 4321, given $String and $RegEx.... Any help would be very much appreciated... GreetZ!,
print "profeth still\n" if /bird|devil/;
Back to
Seekers of Perl Wisdom
|
|