mldvx4 has asked for the wisdom of the Perl Monks concerning the following question:
I would expect that the following would print out all five input lines:
echo -e '55\n44\n33\n22\n11\n' | perl -n -e '@a = <>; END{ print @a; } 'Instead, the first line gets eaten. The first line always gets eaten regardless of how many numbers I send to perl.
What is the explanation for the behavior? What should be changed so that all numbers sent to perl end up in @a?
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: perl -n seemingly eating a line of input
by shmem (Chancellor) on May 01, 2017 at 11:42 UTC | |
by mldvx4 (Friar) on May 01, 2017 at 12:29 UTC | |
by shmem (Chancellor) on May 01, 2017 at 13:18 UTC | |
by bart (Canon) on May 01, 2017 at 13:00 UTC | |
by Anonymous Monk on May 01, 2017 at 12:46 UTC | |
Re: perl -n seemingly eating a line of input
by ikegami (Patriarch) on May 01, 2017 at 15:47 UTC | |
Re: perl -n seemingly eating a line of input
by Anonymous Monk on May 01, 2017 at 22:44 UTC |
Back to
Seekers of Perl Wisdom