Subject: | Pod::Man->new->parse_file() fails with Can't use string ("") as a symbol ref |
Hello,
when using Pod::Man::parse_file() I get an error about using string as
symbol reference:
$ perl -MPod::Man -e
'Pod::Man->new->parse_file(q{/usr/share/perl5/Pod/Man.pm});' Can't use
string ("") as a symbol ref while "strict refs" in use at
/usr/share/perl5/Pod/Man.pm line 730.
Which comes from Pod::Man:
# Output some text, without any additional changes.
sub output {
my ($self, @text) = @_;
[...]
→ print { $$self{output_fh} } @text;
[...]
}
The problem is $self{output_fh} does not exist at the moment.
Pod::Man documentation says the default output is *STDOUT because it's
inherited so from Pod::Simple:
The standard Pod::Simple method parse_file() takes one argument
naming the POD file to read from. By default, the output is sent to
"STDOUT", but this can be changed with the output_fd() method.
Reading Pod::Simple code I can see parse_from_file() sets output_fh, but
parse_file() does not.
My question is: Who's responsible for setting output_fh? Is it
Pod::Simple or sub-classed formater like Pod::Man?
This bug exhibits with any perl release I tested (5.10.1, 5.14.2, blead).
I gave the same question to Pod::Simple maintainer
<https://rt.cpan.org/Public/Bug/Display.html?id=77032>, but he does not
know the answer.
I found similar bug with pod2text reported to you
<https://rt.cpan.org/Public/Bug/Display.html?id=16921> and fixed in
podlators site.
What's your opinion? Should Pod::Simple define the IO handle to align
with your documentation, or are you going to add the output_fh() call
into Pod::Man and change the documentation in podlators?