$ perl 832144.pl GLOB(0x84250b8) unix GLOB(0x84250b8) perlio GLOB(0x8248600) unix GLOB(0x8248600) perlio GLOB(0x8248600) encoding(utf-8-strict) GLOB(0x8248600) utf8 GLOB(0x82610d8) unix GLOB(0x82610d8) perlio $ perl -e'use open qw( :std IO :encoding(UTF-8) ); do $ARGV[0];' 83214 +4.pl GLOB(0x84dbdc8) unix GLOB(0x84dbdc8) perlio GLOB(0x84dbdc8) encoding(utf-8-strict) GLOB(0x84dbdc8) utf8 GLOB(0x82ff610) unix GLOB(0x82ff610) perlio GLOB(0x82ff610) encoding(utf-8-strict) GLOB(0x82ff610) utf8 GLOB(0x8570378) unix GLOB(0x8570378) perlio
The DATA handle is actually the one the parser uses to read the source. use open won't affect the DATA of the file in which the use open occurs since it was opened before the use open was encountered.
use utf8;, on the other hand, will affect the local DATA. You could get some "interesting" interactions.
Your best bet is
binmode(DATA, ':encoding(UTF-8)');
In reply to Re^4: Using "binmode ???, ':encoding(UTF-8)" on the result from "qx//" ?
by ikegami
in thread Using "binmode ???, ':encoding(UTF-8)" on the result from "qx//" ?
by LanX
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |