Jonathan Levi wrote:
#!/usr/bin/env perl
# [comments omitted]
print reverse <>;
drj2:learningperl4 jonathan$ p052e1.pl
1
2
3
3D
2
1
I'm pretty sure that you're just seeing an artefact of executing in
the terminal (ie it's a display problem, rather than a problem with
the output).
If you try to "catch" the output instead, via
p052e1.pl > output.txt
and then "less output.txt" you should notice that the "^D" terminated
input gives the same result as when you point at a file for the input.
Cheers,
Paul