Re: [MacPerl-AnyPerl] optimize reg exp or code

2003-06-21 Thread Bart Lateur
On Wed, 18 Jun 2003 21:31:21 +0200, allan juul wrote: >while () { > s/<(word1|word2|etc|word12)>/ s///g; > print NEWFILE; >} > > >this works fine but is very very slow am sure because of the alternation in the >reg exp. >anyway, does anyone have a better/faster approach The CPAN module Rege

[MacPerl-AnyPerl] optimize reg exp or code

2003-06-18 Thread allan juul
hi i have to search & replace about a dozen different words in 10+ files. my approach was like this my @wordlist = qw (word1 word2 etc word12); ...open files... while () { s/<(word1|word2|etc|word12)>///g; print NEWFILE; } this works fine but is very very slow am sure because of the