in reply to Re: reading several lines in a gulp
in thread reading several lines in a gulp

Why is scalar used in that? What's the effect? I'm staring crosseyed at this very useful solution, can someone decompress this one for me?

Thanks ahead of time for all you experts and your great solutions...

--Ray

Replies are listed 'Best First'.
Re^3: reading several lines in a gulp
by moritz (Cardinal) on Apr 27, 2011 at 12:58 UTC
Re^3: reading several lines in a gulp
by Eliya (Vicar) on Apr 27, 2011 at 12:58 UTC
    Why is scalar used in that? What's the effect?

    push imposes list context (you can push more than one element in one statement), and <$file> would read the whole file at once in list context (as pointed out in the OP).

    In other words, without scalar, the whole file would be read in the first iteration, which would kind of defeat the purpose of the exercise...