Well, it was there (albeit in a more complex form) in the original code, so I thought I'd simplify it but leave it there.
If there's a lot of text and substitutions are only carried out on a small number of lines, then it's probably worth doing a simple check like this - but I'd almost certainly leave it out if I was writing this code from scratch.
As in all cases, the only sure way to know if it's useful is to benchmark the options with something similar to the real data.
--
< http://dave.org.uk>
"The first rule of Perl club is you do not talk about
Perl club." -- Chip Salzenberg
|