* John W. Krahn <[EMAIL PROTECTED]> [2003-02-09 12:27]:
> You can also speed up j1 by using map without the braces.
> 
> sub j1 { my @lines = map chomp && $_, split /^/, $x, -1 }

Which will promptly fail on a last line without a trailing
record separator because chomp would return 0 and cause the
&& to shortcircuit.

What you want is

sub j1 { my @lines = map scalar(chomp, $_), split /^/, $x, -1 }

-- 
Regards,
Aristotle

Reply via email to