harangzsolt33 has asked for the wisdom of the Perl Monks concerning the following question:
print <STDIN>;
you can press Enter, and stdin continues to collect data... but when you do this:
my $L = <STDIN>; print $L;
when you press Enter, stdin will stop collecting, and you will only get ONE line. whereas in the former example, you can enter many lines of input even though the two examples are basically the same. So, I can see that the two codes do slightly different things, but I dont understand why. Can somebody please explain this mystery to me?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Printing from stdin to stdout
by Athanasius (Archbishop) on Aug 26, 2019 at 02:48 UTC | |
by harangzsolt33 (Deacon) on Aug 26, 2019 at 03:30 UTC | |
by haukex (Archbishop) on Aug 26, 2019 at 07:37 UTC | |
by jcb (Parson) on Aug 27, 2019 at 05:12 UTC | |
by haukex (Archbishop) on Aug 27, 2019 at 09:42 UTC |