jplindstrom has asked for the wisdom of the Perl Monks concerning the following question:
#This works my $s = "This is a test"; my $rex = qr/test/i; print "yep\n" if($s =~ $rex); #How do I do this? $rexSubstitution = qr/test/TEST/i; $s =~ $rexSubstitution;
Can that be done, or do I need to evaluate a string at each match? A little searching tells me to go with the string approach.
/J
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: qr and substitution
by Aristotle (Chancellor) on Oct 13, 2003 at 17:40 UTC | |
by jplindstrom (Monsignor) on Oct 13, 2003 at 20:07 UTC | |
|
Re: qr and substitution
by bart (Canon) on Oct 13, 2003 at 22:33 UTC | |
|
Re: qr and substitution
by Roger (Parson) on Oct 14, 2003 at 00:43 UTC | |
|
Re: qr and substitution
by davido (Cardinal) on Oct 13, 2003 at 18:32 UTC | |
by Aristotle (Chancellor) on Oct 13, 2003 at 19:04 UTC |