On 21/07/2011 16:52, Shawn H Corey wrote:
On 11-07-21 11:41 AM, Rob Dixon wrote:
I am pretty sure that the original code is a perversion of
split /\t|\n/;
which is a lazy way of losing a trailing newline without chomping first.
It also seems excessive. This is the same thing:
split /[\t\n]/;
Aside from your regex being longer, I see little to choose between the
two equivalents. One may be slightly faster to execute than the other,
but I wouldn't like to bet on which one, and I hardly see the former as
'excessive'.
On balance I would probably the latter version in my own code, but I
wrote it this way as it was closest to the OP's code of
split /\t\n/;
which was probably incorrect and was confusing people.
Rob
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/