Where's the doc. on perl command-line options?

J

John Doe

For example, I need to know what "perl -an" does. It's not in the
"man perl" page. Could not find it at perl.org or Perlmonks.
Google-searched comp.lang.perl.* for things like "command line
switches," "command line arguments," and "command line options," only
to find info on argument processing. [SARCASM] I admit that anyone
with half a brain should be able to divine which of the 90 (count 'em,
ninety) core documentation modules has what I seek: [/SARCASM]
perl
perltoc
perlreftut
perldsc
perllol
perlrequick
perlretut
perlboot
perltoot
...etcetera, but maybe one of you gurus can clue me in. :)
 
S

Sam Holden

For example, I need to know what "perl -an" does. It's not in the
"man perl" page. Could not find it at perl.org or Perlmonks.
Google-searched comp.lang.perl.* for things like "command line
switches," "command line arguments," and "command line options," only
to find info on argument processing. [SARCASM] I admit that anyone
with half a brain should be able to divine which of the 90 (count 'em,
ninety) core documentation modules has what I seek: [/SARCASM]

If you actually read that one you'll find the line:

perlrun Perl execution and options

Since "-an" is an option that seems to a pointer to the place to
look. If you don't know what an "option" (in the domain of
"execution") is then your OS documentation has failed).

This one contains:

perlrun - how to execute the Perl interpreter


SYNOPSIS
DESCRIPTION
#! and quoting on non-Unix systems
OS/2, MS-DOS, Win95/NT, Macintosh, VMS

Location of Perl
Command Switches
-0[octal/hexadecimal], -a, -C [number/list], -c, -d,
-d:foo[=bar,baz], -Dletters, -Dnumber, -e commandline,
-Fpattern, -h, -i[extension], -Idirectory, -l[octnum],
-m[-]module, -M[-]module, -M[-]'module ...',
-[mM][-]module=arg[,arg]..., -n, -p, -P, -s, -S, -t, -T,
-u, -U, -v, -V, -V:name, -w, -W, -X, -x directory

Which not only points to the appropriate documentation but contains the
two switches in the description (-a and -n).

perlreftut
perldsc
perllol
perlrequick
perlretut
perlboot
perltoot
...etcetera, but maybe one of you gurus can clue me in. :)

None of those have anything to do with the example question, so
looking in them is just silly.

The first two places were the obvious starting points, since they
contain references to the places where the real documentation is,
and as shown above contain what you want if you bother reading them.

You aren't supposed to randomly select a few of the "90" manuals.
You check the overview and the table of contents, just like you
would with any other reference material. You don't just turn to
random pages when trying to find a car mechanic in the phone book,
do you?
 
A

Anno Siegel

John Doe said:
For example, I need to know what "perl -an" does. It's not in the

perldoc perlrun
"man perl" page. Could not find it at perl.org or Perlmonks.
Google-searched comp.lang.perl.* for things like "command line
switches," "command line arguments," and "command line options," only
to find info on argument processing. [SARCASM] I admit that anyone
with half a brain should be able to divine which of the 90 (count 'em,
ninety) core documentation modules has what I seek: [/SARCASM]

The table of contents is perltoc. Looking for "Command Switches" there
finds perlrun.

Anno
 
A

A. Sinan Unur

(e-mail address removed) (John Doe) wrote in
For example, I need to know what "perl -an" does. It's not in the
"man perl" page. Could not find it at perl.org or Perlmonks.
Google-searched comp.lang.perl.* for things like "command line
switches," "command line arguments," and "command line options," only
to find info on argument processing. [SARCASM] I admit that anyone
with half a brain should be able to divine which of the 90 (count 'em,
ninety) core documentation modules has what I seek: [/SARCASM]

Of course, perldoc perlrun, as others have pointed out, contains the
documentation. And you need not divine anything, you can always check
perldoc perltoc to find out.

However, I am curious, did you even try

perl --help

Usage: C:\Perl\bin\perl.exe [switches] [--] [programfile] [arguments]
....
-a autosplit mode with -n or -p (splits $_ into @F)
....
-n assume 'while (<>) { ... }' loop around program

before resorting to sarcasm?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,577
Members
45,054
Latest member
LucyCarper

Latest Threads

Top