Subject: | perldoc -f, -q ignores extra arguments with no notice |
The following problem was submitted to the Perlbug queue. A patch was submitted as well. The ticket is available at http://rt.perl.org/rt3/Ticket/Display.html?id=31227
Gentlemen, would you look at that. Perldoc is ignoring additional
arguments without any qualms:
$ perldoc -f no-op noop
No documentation for perl function `no-op' found
$ perldoc -q no-op noop
No documentation for perl FAQ keyword `no-op' found
However it is acceptable here:
$ perldoc perldoc perlop
Perldoc is only really meant for reading one document at a time.
So these parameters are being ignored: /usr/share/perl/5.8/pod/perlop.pod
--- lib/Pod/Perldoc.pm.orig Wed Jun 23 16:18:22 2004
+++ lib/Pod/Perldoc.pm Mon Sep 20 19:03:37 2004
@@ -668,6 +668,16 @@
# Any sanity-checking need doing here?
+ # But does not make sense to set either -f or -q in $ENV{"PERLDOC"}
+ if( $self->opt_f or $self->opt_q ) {
+ $self->usage("Only one of -f -or -q") if $self->opt_f and $self->opt_q;
+ warn
+ "Perldoc is only really meant for reading one word at a time.\n",
+ "So these parameters are being ignored: ",
+ join(' ', @{$self->{'args'}}),
+ "\n"
+ if @{$self->{'args'}}
+ }
return;
}
@@ -915,7 +925,7 @@
die "Nothing found?!";
# should have been caught before here
} elsif(@$found_things > 1) {
- warn join '',
+ warn
"Perldoc is only really meant for reading one document at a time.\n",
"So these parameters are being ignored: ",
join(' ', @$found_things[1 .. $#$found_things] ),