At 4:13 PM +1030 2/1/06, Paul McCann wrote:
Jonathan Levi wrote:
#!/usr/bin/env perl
# [comments omitted]
print reverse <>;
drj2:learningperl4 jonathan$ p052e1.pl
...
3
3D
..
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.
You were right, the stray "D" didn't appear in output.txt, so I don't
have to worry about it creeping into output files. Many thanks,
Jonathan