Bug#870340: perl: perldoc outputs visible escape sequences again

Niko Tyni ntyni at debian.org
Sat Aug 19 16:01:55 UTC 2017


On Tue, Aug 01, 2017 at 11:57:26AM +0300, Niko Tyni wrote:
> Package: perl
> Version: 5.26.0-4
> 
> As noticed by Olly Betts, the fix for #758689, where we injected the less
> '-R' option in perldoc, has regressed in the 5.26 packages.
> 
> It looks like Pod::Perldoc is now trying to figure out what the pager
> is before injecting options, and possibly gets confused by Debian's
> sensible-pager or something like that.

Right. The pager is set to $Config{pager} by default (see Perldoc.pm:87),
which is sensible-pager on Debian. It can be overridden by at least
setting PAGER in the environment.

Then Pod::Perldoc::ToTerm::pager_configuration() adds LESS=-R in the
environment if the pager matches /less/, and MORE=-R if it matches /more/.

Unfortunately this breaks totally in the PAGER=more case, because
(unlike FreeBSD) our more is not less.

  % PAGER=more perldoc perlfunc
  more: unknown option -R
  
  Usage:
   more [options] <file>...
  
  [...]
 
Hardcoding the pager_configuration() function to always set LESS and
never set MORE should fix this afaics. The difficult part is getting
something upstream that works on Debian and doesn't break elsewhere.
Help would be appreciated on that front.
-- 
Niko Tyni   ntyni at debian.org




More information about the Perl-maintainers mailing list