[Perl] Offer's riddle

Shlomo Yona shlomo at cs.haifa.ac.il
Mon Oct 7 04:18:27 PDT 2002

On Mon, 7 Oct 2002, Mikhael Goikhman wrote:

> > perl -pe'<>' a>b;perl -pe'$_=<>' a>c;
>   perl -pe'<>'<a>b;perl -pe'$_=<>'<a>c

it seems that the only difference is the less-than redirection
of the shell, which does not cause it to hang waiting for input.

How come this works while the way I though you ment doesn't?
Perl takes a as the input file in the line I showed, right?
How does this differ from taking the input from a from standard input?


Shlomo Yona
shlomo at cs.haifa.ac.il

More information about the Perl mailing list