X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2Fopen.pm;h=39e194fd19880726e8a1a6b70e408eaefc4c145b;hb=5d52526064b604c74aa71e290350de1a5cf94862;hp=007b66712d6ac112ca437a2f1f674450b6ee03dd;hpb=61de9fb5aad39c2904a43125c7c70031be6bc679;p=p5sagit%2Fp5-mst-13.2.git diff --git a/lib/open.pm b/lib/open.pm index 007b667..39e194f 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'; @@ -95,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"); @@ -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