X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2Fopen.pm;h=fa2a5181b2f5a0c3e8d92337fb9023a441f7cd67;hb=cc83745da206d409d7227df077f422fd9ecbe680;hp=c2940931b77f39b837739c725031d6c92b22d5c2;hpb=c7732655732824f25d1659f5ebb5d4c3538d32e8;p=p5sagit%2Fp5-mst-13.2.git diff --git a/lib/open.pm b/lib/open.pm index c294093..fa2a518 100644 --- a/lib/open.pm +++ b/lib/open.pm @@ -3,7 +3,7 @@ use warnings; use Carp; $open::hint_bits = 0x20000; # HINT_LOCALIZE_HH -our $VERSION = '1.01'; +our $VERSION = '1.02'; my $locale_encoding; @@ -80,7 +80,7 @@ sub import { foreach my $layer (split(/\s+/,$dscp)) { $layer =~ s/^://; if ($layer eq 'locale') { - use Encode; + require Encode; _get_locale_encoding() unless defined $locale_encoding; (warnings::warnif("layer", "Cannot figure out an encoding to use"), last) @@ -166,9 +166,12 @@ 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" (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. +"layers" (also known as "disciplines") for all I/O. Any two-argument +open(), readpipe() (aka qx//) and similar operators found within the +lexical scope of this pragma will use the declared defaults. +Three-argument opens are not affected by this pragma since there you +(can) explicitly specify the layers and are supposed to know what you +are doing. With the C subpragma you can declare the default layers of input streams, and with the C subpragma you can declare