X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2Fopen.pm;h=c2940931b77f39b837739c725031d6c92b22d5c2;hb=5fef21a34e2a36dc7c83d55110ccc5c57cc7d14d;hp=f7e594b846733930eeafa153940ea46362f424ba;hpb=e2d9456f4494712c79ef86d2fada7b3fad922d2d;p=p5sagit%2Fp5-mst-13.2.git diff --git a/lib/open.pm b/lib/open.pm index f7e594b..c294093 100644 --- a/lib/open.pm +++ b/lib/open.pm @@ -1,7 +1,7 @@ package open; use warnings; use Carp; -$open::hint_bits = 0x20000; +$open::hint_bits = 0x20000; # HINT_LOCALIZE_HH our $VERSION = '1.01'; @@ -27,6 +27,7 @@ sub _get_locale_encoding { } elsif ($ENV{LANG} =~ /^([^.]+)\.([^.]+)$/) { ($country_language, $locale_encoding) = ($1, $2); } + # LANGUAGE affects only LC_MESSAGES only on glibc } elsif (not $locale_encoding) { if ($ENV{LC_ALL} =~ /\butf-?8\b/i || $ENV{LANG} =~ /\butf-?8\b/i) { @@ -94,8 +95,8 @@ sub import { my $target = $layer; # the layer name itself $target =~ s/^(\w+)\(.+\)$/$1/; # strip parameters - unless(PerlIO::Layer::->find($target)) { - warnings::warnif("layer", "Unknown PerlIO layer '$layer'"); + unless(PerlIO::Layer::->find($target,1)) { + warnings::warnif("layer", "Unknown PerlIO layer '$target'"); } } push(@val,":$layer"); @@ -165,12 +166,9 @@ Perl is configured to use PerlIO as its IO system (which is now the default). The C pragma serves as one of the interfaces to declare default -"layers" for all I/O. - -The C pragma is used to declare one or more default layers for -I/O operations. Any open(), readpipe() (aka qx//) and similar -operators found within the lexical scope of this pragma will use the -declared defaults. +"layers" (also known as "disciplines") for all I/O. Any open(), +readpipe() (aka qx//) and similar operators found within the lexical +scope of this pragma will use the declared defaults. With the C subpragma you can declare the default layers of input streams, and with the C subpragma you can declare @@ -253,7 +251,7 @@ pragma. =back -If your locale environment variables (LANGUAGE, LC_ALL, LC_CTYPE, LANG) +If your locale environment variables (LC_ALL, LC_CTYPE, LANG) contain the strings 'UTF-8' or 'UTF8' (case-insensitive matching), the default encoding of your STDIN, STDOUT, and STDERR, and of B, is UTF-8.