From: Nick Ing-Simmons Date: Thu, 9 Aug 2001 06:23:44 +0000 (+0000) Subject: Avoid testing for (non-)existance of "encoding(xxxx)" X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=97ed432b8a5d63d1b7bdda09343e34225e6da722;p=p5sagit%2Fp5-mst-13.2.git Avoid testing for (non-)existance of "encoding(xxxx)" layer is called "encoding" the (xxxx) is an argument. p4raw-id: //depot/perlio@11615 --- diff --git a/lib/open.pm b/lib/open.pm index 1456666..3d7782f 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)$/) {