Perl / perl5

🐪 The Perl programming language
https://dev.perl.org/perl5/
Other
1.85k stars 527 forks source link

v5.8.0: perldoc -m does not accept options in PAGER #6535

Closed p5pRT closed 12 years ago

p5pRT commented 20 years ago

Migrated from rt.perl.org#22329 (status was 'resolved')

Searchable as RT22329$

p5pRT commented 20 years ago

From manojkumar_137@yahoo.co.in

perl v5.8.0

When invoked with -m\, perldoc does not accept options in PAGER (e.g.\, PAGER="less -isr"). The offending code is below (starts at line 473 in the file)​:

if ($opt_m) {   foreach my $pager (@​pagers) {   if (system($pager\, @​found) == 0) {

One fix is to pass a single argument to system()\, perhaps like this​:

  if (system("$pager @​found") == 0) {

This assumes module pathnames need not be quoted.

manoj

________________________________________________________________________ Missed your favourite TV serial last night? Try the new\, Yahoo! TV.   visit http​://in.tv.yahoo.com

p5pRT commented 20 years ago

From @eserte

Manoj Kumar (via RT) \perlbug\-followup@​perl\.org writes​:

# New Ticket Created by Manoj Kumar # Please include the string​: [perl #22329] # in the subject line of all future correspondence about this issue. # \<URL​: http​://rt.perl.org/rt2/Ticket/Display.html?id=22329 >

perl v5.8.0

When invoked with -m\, perldoc does not accept options in PAGER (e.g.\, PAGER="less -isr"). The offending code is below (starts at line 473 in the file)​:

if ($opt_m) { foreach my $pager (@​pagers) { if (system($pager\, @​found) == 0) {

One fix is to pass a single argument to system()\, perhaps like this​:

   if \(system\("$pager @&#8203;found"\) == 0\) \{

This assumes module pathnames need not be quoted.

Or better​:

  if (-x $pager) {   system($pager\, @​found);   } else {   my($pager\, @​args) = split /\s+/\, $pager;   system($pager\, @​args\, @​found);   }

to help people on systems where spaces are common in directory names (e.g. "C​:\Program Files\less.exe").

Regards\,   Slaven

-- Slaven Rezic - slaven@​rezic.de

  tkrevdiff - graphical display of diffs between revisions (RCS or CVS)   http​://ptktools.sourceforge.net/#tkrevdiff

p5pRT commented 20 years ago

From @schwern

On Mon\, May 26\, 2003 at 04​:12​:22PM -0000\, Manoj Kumar wrote​:

When invoked with -m\, perldoc does not accept options in PAGER (e.g.\, PAGER="less -isr"). The offending code is below (starts at line 473 in the file)​:

Technically\, you should be setting that up as​:

PAGER=less LESS=-isr

more works similarly.

if ($opt_m) { foreach my $pager (@​pagers) { if (system($pager\, @​found) == 0) {

One fix is to pass a single argument to system()\, perhaps like this​:

   if \(system\("$pager @&#8203;found"\) == 0\) \{

This assumes module pathnames need not be quoted.

-- I knew right away that my sock and your eyebrows could be best friends.

p5pRT commented 20 years ago

From manojkumar_137@yahoo.co.in

--- Michael G Schwern \perlbug\-followup@&#8203;perl\.org wrote​: > On Mon\, May 26\, 2003 at 04​:12​:22PM -0000\, Manoj Kumar wrote​:

When invoked with -m\, perldoc does not accept options in PAGER (e.g.\, PAGER="less -isr"). The offending code is below (starts at line 473 in the file)​:

Technically\, you should be setting that up as​:

PAGER=less LESS=-isr

Doesn't always work. First\, I don't usually want -sr when I invoke less myself. (Yes\, I can change it while within less\, but that is more hassle.) Second\, I may want another pager that doesn't take options from environment variables.

Note that these code fragments from the perldoc script create pagers with spaces in the names​:

  (my $pager = \<\<'/../') =~ s/\s*\z//;   /usr/bin/less -isr   /../

  if ($^O eq 'os2') {   unshift @​pagers\, 'less'\, 'cmd /c more \<';   }

The perldoc script already has a function page() that handles options correctly but displays only one file. Perhaps the best solution is to use that\, i.e.\, replace

  foreach my $pager (@​pagers) {   if (system($pager\, @​found) == 0) {   exit;   }   }

by

  foreach my $file (@​found) {   page($file\, $no_tty\, @​pagers);   }

manoj

________________________________________________________________________ Send free SMS using the Yahoo! Messenger. Go to http​://in.mobile.yahoo.com/new/pc/

p5pRT commented 12 years ago

From @rjbs

This appears to be fixed by the latest Pod​::Perldoc\, which is in blead.

p5pRT commented 12 years ago

From [Unknown Contact. See original ticket]

This appears to be fixed by the latest Pod​::Perldoc\, which is in blead.

p5pRT commented 12 years ago

@rjbs - Status changed from 'open' to 'resolved'