Subject: | Pod::Simple::parse_file() does not output_fh |
Date: | Mon, 7 May 2012 10:21:12 +0200 |
To: | bug-pod-simple [...] rt.cpan.org |
From: | Petr Pisar <ppisar [...] redhat.com> |
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).
-- Petr
Message body not shown because it is not plain text.