Skip Menu |

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

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

People
Owner: Nobody in particular
Requestors: RandyS [...] ThePierianSpring.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: (no value)
Fixed in: (no value)



Subject: -m uses the wrong pager on MSWin32
Under MSWin32, I have my my PAGER environment variable set to use less. This works fine for perldoc with most usages, but fails when the -m option is used. When the -m option is used it falls back to using the default windows pager, more (which is useless since it only pages forward). Randy.
Subject: -m uses the wrong pager, period
From: ebhanssen [...] allverden.no
This is not just MSWin32. system($pager, @found) fails whenever $pager includes options (thus making perldoc continue until a pager alternative without options is found ... like "more"). This code is run for -m. In other cases, system("$pager \"$output\"") (or, if on VMS, system("$pager $output")) is run instead. (I'll likely have a patch for this tomorrow, but I figured I ought to report it first, just to be sure I don't forget ...) Eirik -- Eirik Berg Hanssen, ebhanssen@allverden.no Just this .sig then nothing more
I am a little confused. As I was testing my fix, I found that the bug did not affect MSWin32 at all (system LIST being flattened on that platform). (Perlmonk ikegami suggested that perhaps the original requestor meant Cygwin, not MSWin32.) Also, I have a little trouble seeing why the page_module_file method even exists. It was slightly different from the page method, but I could not see why. I have retained this method, but it is now essentially a wrapper around the page method, with a warning if more than one file is found. The patch attached is against Pod-Perldoc-3.14_03. I have tested it on Linux, Cygwin, and Win98. No VMS here, sorry. -- Eirik Berg Hanssen, ebhanssen@allverden.no Just this .sig then nothing more
diff -Naur Pod-Perldoc-3.14_03/lib/Pod/Perldoc.pm Pod-Perldoc-work/lib/Pod/Perldoc.pm --- Pod-Perldoc-3.14_03/lib/Pod/Perldoc.pm 2007-09-03 19:08:45.000000000 +0000 +++ Pod-Perldoc-work/lib/Pod/Perldoc.pm 2007-10-25 21:57:39.000000000 +0000 @@ -1342,55 +1342,15 @@ # occasionally hazy distinction between OS-local extension # associations, and browser-specific MIME mappings. - if ($self->{'output_to_stdout'}) { - $self->aside("Sending unpaged output to STDOUT.\n"); - local $_; - my $any_error = 0; - foreach my $output (@found) { - unless( open(TMP, "<", $output) ) { # XXX 5.6ism - warn("Can't open $output: $!"); - $any_error = 1; - next; - } - while (<TMP>) { - print or die "Can't print to stdout: $!"; - } - close TMP or die "Can't close while $output: $!"; - $self->unlink_if_temp_file($output); - } - return $any_error; # successful + if(@found > 1) { + warn + "Perldoc is only really meant for reading one document at a time.\n", + "So these files are being ignored: ", + join(' ', @found[1 .. $#found] ), + "\n" } - foreach my $pager ( $self->pagers ) { - $self->aside("About to try calling $pager @found\n"); - if (system($pager, @found) == 0) { - $self->aside("Yay, it worked.\n"); - return 0; - } - $self->aside("That didn't work.\n"); - - # Odd -- when it fails, under Win32, this seems to neither - # return with a fail nor return with a success!! - # That's discouraging! - } - - $self->aside( - sprintf "Can't manage to find a way to page [%s] via pagers [%s]\n", - join(' ', @found), - join(' ', $self->pagers), - ); - - if (IS_VMS) { - DEBUG > 1 and print "Bailing out in a VMSish way.\n"; - eval q{ - use vmsish qw(status exit); - exit $?; - 1; - } or die; - } - - return 1; - # i.e., an UNSUCCESSFUL return value! + return $self->page($found[0], $self->{'output_to_stdout'}, $self->pagers); } #..........................................................................
I'll look at this to see what I can find. If anyone has solutions, let me know.
On Thu Oct 25 19:35:18 2007, EBHANSSEN wrote: Show quoted text
> I have a little trouble seeing why the page_module_file method > even exists. It was slightly different from the page method, but I > could not see why. I have retained this method, but it is now > essentially a wrapper around the page method, with a warning if more > than one file is found. > > The patch attached is against Pod-Perldoc-3.14_03. I have tested it on > Linux, Cygwin, and Win98. No VMS here, sorry.
Applied and verified tested. Thanks!