Skip Menu |
 

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

Report information
The Basics
Id: 131844
Status: resolved
Estimated: 30 min
Priority: 0/
Queue: Pod-Usage

People
Owner: Marek.Rouchal [...] gmx.net
Requestors: karl [...] freefriends.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 1.69
Fixed in: 1.70



Subject: preferring PAGER to $Config{pager}
Date: Sun, 16 Feb 2020 15:10:18 -0700
To: bug-Pod-Usage [...] rt.cpan.org
From: Karl Berry <karl [...] freefriends.org>
Download (untitled) / with headers
text/plain 220b
Line 164 of Pod/Usage.pm from perl 5.30.1 is: system(($Config{pager} || $ENV{PAGER} || '/bin/more'), $1); I suggest that the user-set $ENV{PAGER} should be preferred to the Perl-set $Config{pager}. --thanks, karl.
Download (untitled) / with headers
text/plain 926b
On Sun Feb 16 18:05:42 2020, karl@freefriends.org wrote: Show quoted text
> Line 164 of Pod/Usage.pm from perl 5.30.1 is: > > system(($Config{pager} || $ENV{PAGER} || '/bin/more'), $1); > > I suggest that the user-set $ENV{PAGER} should be preferred to the > Perl-set $Config{pager}. --thanks, karl.
+1 See attachment, which is a variation on the program presented inline by the OP in https://rt.cpan.org/Public/Bug/Display.html?id=131845 and which implements the recommended switch in argument order. On FreeBSD-11, where one typically sets PAGER in ~/.profile and where (for me, at least) there is no /etc/issue file, I get these results: ##### $ perl rtc-131844-pod-usage.pl config-pager: /usr/bin/less -R env-pager: less /etc/issue: No such file or directory return: 256 ##### ... which is a more accurate description of the state of the system than with the current order of switches. Thank you very much. Jim Keenan
Subject: rtc-131844-pod-usage.pl
use Config; print "config-pager: $Config{pager}\n"; print "env-pager: $ENV{PAGER}\n"; $ret = system($ENV{PAGER} || ($Config{pager} || '/bin/more'), "/etc/issue"); print "return: $ret\n";
Download (untitled) / with headers
text/plain 437b
I tend to update the code to use system($cmdline) rather than system(@cmdarray) - and do some humble attempt to get the quoting right on the file name. Adding a dependency on Text::ShellWords and/or String::ShellQuote does not seem appropriate for this portion of the code, since anyway perldoc should do the job, and paging the raw script is a last resort only. Is this direction acceptable for you? And sorry for the long wait. -Marek
Subject: Re: [rt.cpan.org #131844] preferring PAGER to $Config{pager}
Date: Sun, 15 Mar 2020 15:44:53 -0600
To: bug-Pod-Usage [...] rt.cpan.org
From: Karl Berry <karl [...] freefriends.org>
Download (untitled) / with headers
text/plain 312b
Hi Marek - thanks for the reply. Sure, using system($string) vs. system(@arr) is clearly your choice. Whatever works for you :). But the point of this report (just trying to be clear) was to have the user-set $ENV{PAGER} override the Perl-set $Config{pager}, instead of the other way around ... --thanks, karl.
Subject: Re: [rt.cpan.org #131844] preferring PAGER to $Config{pager}
Date: Sun, 15 Mar 2020 23:20:40 +0100
To: bug-Pod-Usage [...] rt.cpan.org
From: "Marek Rouchal" <marek [...] rouchal.net>
Right - and since its in the same few lines of code, $ENV{PAGER} will be preferred over $Config{pager}. That was a simple swap. However, the bigger challenge was to find the optimal trade-off to support "less -R" and file names that may contain blanks or meta-chars. That's why I mentioned this, and forgot to state clearly that the preference swap is well understood. Thanks for the reminder. 
Version 1.70 should start appearing on CPAN... appr Queue: Pod-Usage Ticket Hi Marek - thanks for the reply. Sure, using system($string) vs. system(@arr) is clearly your choice. Whatever works for you :). But the point of this report (just trying to be clear) was to have the user-set $ENV{PAGER} override the Perl-set $Config{pager}, instead of the other way around ... --thanks, karl.
Closing as fixed in Pod-Usage-1.70. Thank you for your patience. -Marek


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.