Reputation: 1199
I want to look the definition of ARGV,$ARGV,@ARGV
, so I use perldoc to find it. Since it's not a sub nor a module ,perldoc -f
or perldoc module
would not help.
I asked someone and he told me to look at perldoc perlvar
,and I found ARGV section.
My question is how to find some general term in Perl Document? Or how to find out that ARGV is in perlvar
? Some universal search tool to do this?
Upvotes: 4
Views: 181
Reputation: 67910
Found after a brief search of perldoc --help
:
....
-v Search predefined Perl variables
So, basically:
$ perldoc -v @ARGV
@ARGV The array @ARGV contains the command-line arguments intended
for the script. $#ARGV is generally the number of arguments
minus one, because $ARGV[0] is the first argument, not the
program's command name itself. See $0 for the command name.
Though you'll have to be creative when looking up scalars to avoid shell interpolation:
perldoc -f '$ARGV'
Upvotes: 4
Reputation: 22294
Personally, I started reading the perl documentation with perldoc perl
. It has a brief overview of all the perl docs (except modules) present in your version of perl. For a bit more detail, you'll notice that one of the docs in the "Overview" section is "perltoc", so a bit of dry reading in perldoc perltoc
would likely answer your question.
Upvotes: 0
Reputation: 80433
perldoc is not the solution; it’s the problem. The solution is either:
$ cd src/perl/pod
$ grep foo *.pod
or
$ cd src/perl/pod
$ pod2text `grep -l foo *.pod` | more
Accept no substitutes.
Upvotes: 1