Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

Re: Uncommon but Useful Perl Command Line Options

by ysth (Canon)
on Jan 28, 2004 at 20:31 UTC ( #324773=note: print w/ replies, xml ) Need Help??

in reply to Uncommon* but Useful Perl Command Line Options for One-liners

I'd take out the part from perldoc perl and replace it with the output from perl --help. Seems perl.pod has gotten out of date. In particular, I notice the -C switch (which did one thing <5.8.1 and something very different >=5.8.1) is missing.

Output from 5.8.3:

Usage: ./perl [switches] [--] [programfile] [arguments] -0[octal] specify record separator (\0, if no argument) -a autosplit mode with -n or -p (splits $_ into @F) -C[number/list] enables the listed Unicode features -c check syntax only (runs BEGIN and CHECK blocks) -d[:debugger] run program under debugger -D[number/list] set debugging flags (argument is a bit mask or alpha +bets) -e program one line of program (several -e's allowed, omit prog +ramfile) -F/pattern/ split() pattern for -a switch (//'s are optional) -i[extension] edit <> files in place (makes backup if extension su +pplied) -Idirectory specify @INC/#include directory (several -I's allowe +d) -l[octal] enable line ending processing, specifies line termin +ator -[mM][-]module execute `use/no module...' before executing program -n assume 'while (<>) { ... }' loop around program -p assume loop like -n but print line also, like sed -P run program through C preprocessor before compilatio +n -s enable rudimentary parsing for switches after progra +mfile -S look for programfile using PATH environment variable -t enable tainting warnings -T enable tainting checks -u dump core after parsing program -U allow unsafe operations -v print version, subversion (includes VERY IMPORTANT p +erl info) -V[:variable] print configuration summary (or a single v +ariable) -w enable many useful warnings (RECOMMENDED) -W enable all warnings -x[directory] strip off text before #!perl line and perhaps cd to +directory -X disable all warnings

Also, I have trouble with your "Uncommon". Seems to me you cover only the most common switches (other than -w).

Replies are listed 'Best First'.
Re: Re: Uncommon but Useful Perl Command Line Options
by Sol-Invictus (Scribe) on Jan 28, 2004 at 22:01 UTC
    ok will edit the text to point to perl --help, as to uncommon, I was aiming for people who have little or no experience of using command line opts (except for -w,-i,-T) I will make that clearer at the outset
      You seem to have picked the ones most useful for one-liners (but not only for one-liners, of course). Perhaps you could work that into the title somehow? Or maybe that would scare people off.
        ok the title is a bit ambiguous but my intention was to write about one liners so ....

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://324773]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2016-08-24 10:07 GMT
Find Nodes?
    Voting Booth?
    The best thing I ever won in a lottery was:

    Results (342 votes). Check out past polls.