in reply to Re^2: Using "binmode ???, ':encoding(UTF-8)" on the result from "qx//" ?
in thread Using "binmode ???, ':encoding(UTF-8)" on the result from "qx//" ?
#!/usr/bin/perl -- use strict; use warnings; use open qw' :std IO :encoding(UTF-8) '; use autodie; Main(@ARGV); exit(0); sub Main { open my ($ThisFh), '<', __FILE__; PrintLayers( \*DATA, \*STDOUT, $ThisFh ); close $ThisFh; } sub PrintLayers { for my $Fh (@_) { print "$Fh $_\n" for PerlIO::get_layers($Fh); print "\n"; } } ## end sub PrintLayers __DATA__ GLOB(0x9b083c) unix GLOB(0x9b083c) crlf GLOB(0x979d5c) unix GLOB(0x979d5c) crlf GLOB(0x979d5c) encoding(utf-8-strict) GLOB(0x979d5c) utf8 GLOB(0x3d8b0c) unix GLOB(0x3d8b0c) crlf GLOB(0x3d8b0c) encoding(utf-8-strict) GLOB(0x3d8b0c) utf8
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Using "binmode ???, ':encoding(UTF-8)" on the result from "qx//" ?
by ikegami (Patriarch) on Mar 31, 2010 at 20:34 UTC |