Skip to content

Commit

Permalink
load PerlIO before trying to use its functions
Browse files Browse the repository at this point in the history
  • Loading branch information
haarg authored and rra committed Mar 15, 2024
1 parent 34d8417 commit 1667094
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/Pod/Man.pm
Original file line number Diff line number Diff line change
Expand Up @@ -842,6 +842,7 @@ sub start_document {
if ($$self{ENCODING}) {
$$self{ENCODE} = 1;
eval {
require PerlIO;
my @options = (output => 1, details => 1);
my @layers = PerlIO::get_layers (*{$$self{output_fh}}, @options);
if ($layers[-1] && ($layers[-1] & PerlIO::F_UTF8 ())) {
Expand Down
1 change: 1 addition & 0 deletions lib/Pod/Text.pm
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,7 @@ sub start_document {
# disable encoding.
$$self{ENCODE} = 1;
eval {
require PerlIO;
my @options = (output => 1, details => 1);
my $flag = (PerlIO::get_layers ($$self{output_fh}, @options))[-1];
if ($flag && ($flag & PerlIO::F_UTF8 ())) {
Expand Down

0 comments on commit 1667094

Please sign in to comment.