Skip Menu |

This queue is for tickets about the Pod-Perldoc CPAN distribution.

Report information
The Basics
Id: 104695
Status: resolved
Priority: 0/
Queue: Pod-Perldoc

People
Owner: Nobody in particular
Requestors: explorer [...] joaquinferrero.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 3.25
Fixed in: (no value)



Subject: "perldoc -f" show nothing if not perlfunc.pod file translated exists
Normally, perldoc search the function indicated with '-f': --------------------------------------------------------------------------------- $ perldoc -f abs abs VALUE abs Returns the absolute value of its argument. If VALUE is omitted, uses $_. --------------------------------------------------------------------------------- perldoc with a POD2::xx distribution installed, perldoc search for perlfunc.pod file translated: --------------------------------------------------------------------------------- $ perldoc -V Perldoc v3.25, under perl v5.022000 for linux $ echo $PERLDOC_POD2 es $ perldoc -f abs abs VALOR abs Devuelve el valor absoluto del argumento. Si se omite VALOR, se usa $_. --------------------------------------------------------------------------------- BUT... if perlfunc.pod is NOT translated, perldoc should to read original perlfunc.pod file, but perlfunc is special with "perldoc -f". Perldoc.pm: --------------------------------------------------------------------------------- 1307 my $re = 'Alphabetical Listing of Perl Functions'; 1308 1309 # Check available translator or backup to default (english) 1310 if ( $self->opt_L && defined $self->{'translators'}->[0] ) { 1311 my $tr = $self->{'translators'}->[0]; 1312 $re = $tr->search_perlfunc_re if $tr->can('search_perlfunc_re'); 1313 if ( $] < 5.008 ) { 1314 $self->aside("Your old perl doesn't really have proper unicode support."); 1315 } 1316 } 1317 1318 # Skip introduction 1319 local $_; 1320 while (<$fh>) { 1321 /^=encoding\s+(\S+)/ && $self->set_encoding($fh, $1); 1322 last if /^=head2 $re/; 1323 } 1324 --------------------------------------------------------------------------------- Perldoc.pm tried to change $re to translated version. $re = $tr->search_perlfunc_re can return a valid string, but perlfunc.pod can be not installed into POD2::xx distribution (Example: POD2-ES-5.16.2.02) So, the while loop at 1320 fail to find, because $fh is the filehandle of original (english) perlfunc.pod: --------------------------------------------------------------------------------- $ perldoc -f abs No documentation for perl function 'abs' found --------------------------------------------------------------------------------- Workaround (increase sturdiness): --------------------------------------------------------------------------------- 1322c1322 < last if /^=head2 $re/; --- Show quoted text
> last if /^=head2 (?:$re|Alphabetical Listing of Perl Functions)/;
---------------------------------------------------------------------------------
On Mon May 25 15:38:04 2015, explorer@joaquinferrero.com wrote: Show quoted text
> Workaround (increase sturdiness): > --------------------------------------------------------------------------------- > 1322c1322 > < last if /^=head2 $re/; > ---
> > last if /^=head2 (?:$re|Alphabetical Listing of Perl Functions)/;
> ---------------------------------------------------------------------------------
This is a great suggestion. Thanks. I will include it in a forthcoming release.
On Mon May 25 15:38:04 2015, explorer@joaquinferrero.com wrote: Show quoted text
> Workaround (increase sturdiness): > --------------------------------------------------------------------------------- > 1322c1322 > < last if /^=head2 $re/; > ---
> > last if /^=head2 (?:$re|Alphabetical Listing of Perl Functions)/;
> ---------------------------------------------------------------------------------
Just merged this: https://github.com/mrallen1/Pod-Perldoc/pull/17 Please give it a try and let us know how it works. Thanks!