in reply to Re: STDIN behaves different according to context
in thread STDIN behaves different according to context

In such a case, it might be useful to figure out what exactly is coming into STDIN without your knowing about it. Try converting each character to its numeric value and write that:

my $a = <>; local $, = ' '; # Put some whitesapce between each number print unpack("U*", $a), "\n";

Above is untested, as always.

----
Invent a rounder wheel.