develooper Front page | perl.perl5.porters | Postings from May 2003

Re: [perl #22329] v5.8.0: perldoc -m does not accept options in PAGER

Thread Previous
From:
Slaven Rezic
Date:
May 27, 2003 13:44
Subject:
Re: [perl #22329] v5.8.0: perldoc -m does not accept options in PAGER
Message ID:
87n0h8t98y.fsf@vran.herceg.de
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 @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

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About