diff options
author | Jerry D. Hedden <jdhedden@cpan.org> | 2007-03-01 22:59:41 -0800 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2007-03-06 11:19:04 +0000 |
commit | 0a37092fbc61eea427a132768737d48450e8466c (patch) | |
tree | 87dde627c5e30717b7711ddd3130a7998fc72c86 /lib/Pod | |
parent | 6902c96abfac199dee031c2d64ebdf840b87fa4d (diff) | |
download | perl-0a37092fbc61eea427a132768737d48450e8466c.tar.gz |
'Unknown PerlIO layer "encoding"...' message
From: "Jerry D. Hedden" <jdhedden@yahoo.com>
Message-ID: <794180.55454.qm@web30208.mail.mud.yahoo.com>
p4raw-id: //depot/perl@30485
Diffstat (limited to 'lib/Pod')
-rw-r--r-- | lib/Pod/t/man.t | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/Pod/t/man.t b/lib/Pod/t/man.t index e09f8deedc..3ad1f83141 100644 --- a/lib/Pod/t/man.t +++ b/lib/Pod/t/man.t @@ -29,6 +29,8 @@ use Pod::Man; $loaded = 1; print "ok 1\n"; +my $have_encoding = eval { require PerlIO::encoding; 1; } && ! $@; + my $parser = Pod::Man->new or die "Cannot create parser\n"; my $n = 2; while (<DATA>) { @@ -36,9 +38,8 @@ while (<DATA>) { open (TMP, '> tmp.pod') or die "Cannot create tmp.pod: $!\n"; # We have a test in ISO 8859-1 encoding. Make sure that nothing strange - # happens if Perl thinks the world is Unicode. Wrap this in eval so that - # older versions of Perl don't croak. - eval { binmode (\*TMP, ':encoding(iso-8859-1)') }; + # happens if Perl thinks the world is Unicode. + binmode (\*TMP, ':encoding(iso-8859-1)') if $have_encoding; while (<DATA>) { last if $_ eq "###\n"; |