On Tue, 8 Aug 2000 11:25:56 -0500, Jonathan Scott Duff wrote:

>Someone proposed (I think I deleted that email) to make 
>
>       while (<FH>) { ...  }
>
>work like 
>
>       while (<FH>) { chomp; ... }

Guilty.

I've benchmarked the above codes, with '...' replaced by nothing, chomp
vs. the -l command line switch, and it turns out that the implicit chomp
of -l is almost 10% faster than the explicit chomp() of the traditional
approach: 9.83 seconds (implicit) vs. 10.77 seconds (explicit), on the
same file.

The culprit is that $/ set to something other than "" (or undef) slows
down the printing considerably: abnout 20%. This probably could be
improved by a lot.

-- 
        Bart.

Reply via email to