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

Discussion in 'Perl Misc' started by John Doe, Aug 31, 2004.

  1. John Doe

    John Doe Guest

    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. :)
     
    John Doe, Aug 31, 2004
    #1
    1. Advertising

  2. John Doe

    Sam Holden Guest

    On 31 Aug 2004 00:14:25 -0700, John Doe <> wrote:
    > 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


    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).

    > perltoc


    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?

    --
    Sam Holden
     
    Sam Holden, Aug 31, 2004
    #2
    1. Advertising

  3. John Doe

    Anno Siegel Guest

    John Doe <> wrote in comp.lang.perl.misc:
    > 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
     
    Anno Siegel, Aug 31, 2004
    #3
  4. (John Doe) wrote in
    news::

    > 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?

    --
    A. Sinan Unur
    d
    (remove '.invalid' and reverse each component for email address)
     
    A. Sinan Unur, Aug 31, 2004
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Matt
    Replies:
    3
    Views:
    549
    Tor Iver Wilhelmsen
    Sep 17, 2004
  2. Replies:
    8
    Views:
    400
    Fabio Fracassi
    May 4, 2005
  3. hue

    Parse command line options

    hue, Apr 18, 2005, in forum: Python
    Replies:
    5
    Views:
    403
  4. Replies:
    3
    Views:
    318
    Roland Pibinger
    Jan 11, 2007
  5. CSUIDL PROGRAMMEr

    getting from command line options to file

    CSUIDL PROGRAMMEr, Apr 16, 2007, in forum: Python
    Replies:
    3
    Views:
    290
    Gabriel Genellina
    Apr 20, 2007
Loading...

Share This Page