in reply to Re^3: Tokenizing and qr// <=> /g interplay
in thread Tokenizing and qr// <=> /g interplay
However, as you can see (?) from the example above, I have lots of crummy/good switchouts to do, and is my plodding approach above the best that can be expected?my ( $crummy, $good ); foreach my $crummy_good_ar ( @corrections_to_make ) { ( $crummy, $good ) = @$crummy_good_ar; $file_in_string_form =~ s/\b(\Q$crummy\E)\b/$good/ig; }
P.S. Can you clarify/update what you meant by:
the benefit of qr// objects is lost if there is additional text in the pattern match
I think you are saying that a precompiled/qr regex used in a follow-on regex will have to be recompiled if you snap additional text on to the qr'd variable, because the overall text of the new regex will be different. Although at least one would still have the benefit of 'concentrated regex logic' within the qr'd variable?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Tokenizing and qr// <=> /g interplay
by japhy (Canon) on Apr 25, 2005 at 12:36 UTC | |
by ff (Hermit) on Apr 25, 2005 at 13:37 UTC |