This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
The ${"\cTAINT"} raises the ire of 'use strict'.
[perl5.git] / lib / open.pm
index 1456666..d8a6350 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)$/) {
@@ -155,6 +156,7 @@ level.
 
 =head1 SEE ALSO
 
-L<perlfunc/"binmode">, L<perlfunc/"open">, L<perlunicode>, L<PerlIO>
+L<perlfunc/"binmode">, L<perlfunc/"open">, L<perlunicode>, L<PerlIO>,
+L<encoding>
 
 =cut