Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

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


Comment on Re: Uncommon but Useful Perl Command Line Options
Download Code
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?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (6)
As of 2015-07-30 05:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (270 votes), past polls