Perl Monk, Perl Meditation | |
PerlMonks |
perl -n seemingly eating a line of inputby mldvx4 (Friar) |
on May 01, 2017 at 11:15 UTC ( [id://1189251]=perlquestion: print w/replies, xml ) | Need Help?? |
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?
Back to
Seekers of Perl Wisdom
|
|