in reply to Read from Input

perl -e "print <>"

Replies are listed 'Best First'.
Re: Re: Read from Input
by Anonymous Monk on May 07, 2004 at 12:20 UTC
    Actually in your program <> is interpreted in list context, because this is standard context for print. This means that nothing is outputted until the user enters ^Z (or whatever else end of input is). You might want to go with perl -e "for (1..10) { print scalar <> }".

      You are absolutely right. I was, though, trying to hint towards the use of <> and $_, without providing the entire two-line program.

      As for the 10x - I just #ifgnored it.