Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^2: Regex stored in a scalar

by girarde (Hermit)
on Aug 22, 2015 at 14:33 UTC ( [id://1139524] : note . print w/replies, xml ) Need Help??


in reply to Re: Regex stored in a scalar
in thread Regex stored in a scalar

sed would likely be wicked fast for this, too.

Replies are listed 'Best First'.
Re^3: Regex stored in a scalar
by Laurent_R (Canon) on Aug 22, 2015 at 16:32 UTC
    It depends on the quality of the sed implementation (and also the Perl version). I have seen cases where Perl was 2 to 5 times faster than either sed or awk (I don't remember for sure from which vendor), although this was more than 10 years ago. In the more recent tests I made (but with rather old OS), there was no significant difference and it would also depend on the complexity of the processing being applied.

    I think that, in general, tests are required to decide the best way to go (if it matters at all, e.g. if your files to be processed are really so large that it will make a significant difference for you).