Because @ARGV is not empty when you read with <>, the handle that is read from is not STDIN but ARGV instead.
use open IO => ':utf8'; may work better (ARGV is only opened by <> at which point it's to late to call binmode because some data as already been read.)
s/perlvar/ARGV/, thanks choroba
In reply to Re: encoding trouble
by Eily
in thread [SOLVED] encoding trouble
by Skeeve
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |