in reply to Re: Advantage of while(<>){while()}?
in thread Advantage of while(<>){while()}?

Even if I'm slurping the entire file in in both cases (local $/)?

Elda Taluta; Sarks Sark; Ark Arks

Replies are listed 'Best First'.
Re^3: Advantage of while(<>){while()}?
by ikegami (Patriarch) on May 18, 2011 at 22:24 UTC

    Oh, I didn't notice that you added local $/; to the first snippet too!

    local $/; while (<>) provides error checking (empty file, read error) that local $/; $_ = <>; doesn't.

      My fault for leaving the $/ part out originally! Been looking at this code for too long. :(

      Elda Taluta; Sarks Sark; Ark Arks