Skip Menu |

This queue is for tickets about the podlators CPAN distribution.

Report information
The Basics
Id: 77530
Status: resolved
Priority: 0/
Queue: podlators

People
Owner: Nobody in particular
Requestors: ppisar [...] redhat.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 2.0.1
Fixed in: 2.4.1



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?
Subject: Re: [rt.cpan.org #77530] Pod::Man->new->parse_file() fails with Can't use string ("") as a symbol ref
Date: Wed, 30 May 2012 11:46:53 -0700
To: bug-podlators [...] rt.cpan.org
From: Russ Allbery <rra [...] stanford.edu>
"Petr Pisar via RT" <bug-podlators@rt.cpan.org> writes: Show quoted text
> when using Pod::Man::parse_file() I get an error about using string as > symbol reference:
Show quoted text
> $ 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.
Show quoted text
> Which comes from Pod::Man:
Show quoted text
> # Output some text, without any additional changes. > sub output { > my ($self, @text) = @_; > [...] > → print { $$self{output_fh} } @text; > [...] > }
Show quoted text
> The problem is $self{output_fh} does not exist at the moment.
Show quoted text
> Pod::Man documentation says the default output is *STDOUT because it's > inherited so from Pod::Simple:
Show quoted text
> 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.
Show quoted text
> Reading Pod::Simple code I can see parse_from_file() sets output_fh, but > parse_file() does not.
Show quoted text
> My question is: Who's responsible for setting output_fh? Is it > Pod::Simple or sub-classed formater like Pod::Man?
I thought Pod::Simple was doing this, but now I'm not sure whether it ever did. Since Pod::Man documented this was supposed to work, I've just added a wrapper in Pod::Man that will be in the next release to handle it properly. Thanks for the report! -- Russ Allbery (rra@stanford.edu) <http://www.eyrie.org/~eagle/>