How to find a specific term in a Perl document?

I want to look at the definition of ARGV,$ARGV,@ARGV , so I use perldoc to find it. Since this is not a sub or module, perldoc -f or perldoc module would not help.

I asked someone and he told me to look at perldoc perlvar and I found the ARGV section.

My question is how to find a generic term in a Perl Document? Or how to find out that ARGV is in perlvar ? Is a universal search tool used for this?

+4
source share
4 answers

Found after a brief search 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 command name itself. See $0 for the command name. 

Although you need to be creative when looking for scalars to avoid shell interpolation:

 perldoc -f '$ARGV' 
+4
source

perldoc is not a solution; his problem. Decision:

 $ cd src/perl/pod $ grep foo *.pod 

or

 $ cd src/perl/pod $ pod2text `grep -l foo *.pod` | more 

Do not accept replacement.

+1
source

Another alternative: Google uses

 site:perldoc.perl.org TERM 
+1
source

Personally, I started reading perl documentation with perldoc perl . It contains a brief overview of all perl documents (except modules) present in your version of perl. For more details, you will notice that one of the documents in the Overview section is β€œperltoc”, so a little dry reading in perldoc perltoc will likely answer your question.

0
source

Source: https://habr.com/ru/post/1396758/


All Articles