diff options
-rw-r--r-- | lib/open.pm | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/open.pm b/lib/open.pm index 1456666edd..3d7782fc8b 100644 --- a/lib/open.pm +++ b/lib/open.pm @@ -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)$/) { |