Report layer name (without arg) on fail, and attempt to
Nick Ing-Simmons [Wed, 22 Jan 2003 09:06:23 +0000 (09:06 +0000)]
autoload layer name. (Fix for [perl #20460]).

p4raw-id: //depot/perlio@18549

lib/open.pm

index d771fcb..c294093 100644 (file)
@@ -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");