develooper Front page | perl.perl5.porters | Postings from July 2014

Re: command line options

Thread Previous | Thread Next
H.Merijn Brand
July 28, 2014 06:24
Re: command line options
Message ID:
On Sun, 27 Jul 2014 23:07:59 +0200, Abigail <> wrote:

> On Sun, Jul 27, 2014 at 09:41:45AM -0400, Peter Martini wrote:
> > While we're discussing adding '-N' and '-P' flags, I noticed a while
> > ago that '-h' is not one of the documented flags when running 'perl
> > -h'.
> > 
> > points out
> > this is intentional, and that "[the perl -h output] really ought to be
> > max 23 lines".
> > 
> > Is that something we still want to hold ourselves too?
>     $ perl -h | wc -l
>     33
>     $
> Since all other command line options, even the most obscure ones (how many
> people have the need for -u/-U/-f/-s/-S, but need -h to remind themselves

If -s is used, it most likely is on the hashbang line. I have scripts
that use it. The other ones I had to look up.

I used Johan's pocket reference 3rd ed and 5th ed, and -f isn't even
listed in either :)

> which option to use?), and noone seems to have made an effort to further
> reduce the 33 lines, I don't think much harm will be done to add -h back.
> OTOH, I don't see much added benefit in adding it back either, other than
> just being complete.

But I fully subscribe to «perl -h» refering to 'perldoc perlrun'
instead of 'perldoc perl' (or both)

In perldoc perlrun, -X is sorted before -X whereas all other options
sort lower (-n) before upper (-N)

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[t][:MOD[=a,b]] run program under debugger
  -D[number/list]   set debugging flags (argument is a bit mask or alphabets)
- -e program        one line of program (several -e's allowed, omit programfile)
+ -e commandline    one line of program (several -e's allowed, omit programfile)
- -E program        like -e, but enables all optional features
+ -E commandline    like -e, but enables all optional features
- -f                don't do $sitelib/ at startup
+ -f                Disable executing $sitelib/ at startup.
  -F/pattern/       split() pattern for -a switch (//'s are optional)
+ -h                prints a summary of the options.
  -i[extension]     edit <> files in place (makes backup if extension supplied)
  -Idirectory       specify @INC/#include directory (several -I's allowed)
- -l[octal]         enable line ending processing, specifies line terminator
+ -l[octnum]         enable line ending processing, specifies line terminator
- -[mM][-]module    execute "use/no module..." before executing program
+ -[mM][-]mod[=arg] execute "use/no module..." before executing program
  -n                assume "while (<>) { ... }" loop around program
  -p                assume loop like -n but print line also, like sed
  -s                enable rudimentary parsing for switches after programfile
  -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, patchlevel and license
  -V[:variable]     print configuration summary (or a single variable)
  -w                enable many useful warnings
  -W                enable all warnings
  -x[directory]     ignore text before #!perl line (optionally cd to directory)
  -X                disable all warnings

Run 'perldoc perl' for more help with Perl.

H.Merijn Brand   Perl Monger
using perl5.00307 .. 5.19   porting perl5 on HP-UX, AIX, and openSUSE

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About