This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Avoid testing for (non-)existance of "encoding(xxxx)"
authorNick Ing-Simmons <nik@tiuk.ti.com>
Thu, 9 Aug 2001 06:23:44 +0000 (06:23 +0000)
committerNick Ing-Simmons <nik@tiuk.ti.com>
Thu, 9 Aug 2001 06:23:44 +0000 (06:23 +0000)
layer is called "encoding" the (xxxx) is an argument.

p4raw-id: //depot/perlio@11615

lib/open.pm

index 1456666..3d7782f 100644 (file)
@@ -71,9 +71,10 @@ sub import {
                } else {
                    $layer = "encoding($locale_encoding)";
                }
-           }
-           unless(PerlIO::Layer::->find($layer)) {
-               carp("Unknown discipline layer '$layer'");
+           } else {
+               unless(PerlIO::Layer::->find($layer)) {
+                   carp("Unknown discipline layer '$layer'");
+               }
            }
            push(@val,":$layer");
            if ($layer =~ /^(crlf|raw)$/) {