D.1. Command Line Arguments

The following table lists the various command line arguments that you can use with Perl. Note that you can also specify arguments on the #! line within individual scripts similar to the following code:

#!/usr/bin/perl -U

ArgumentUse
-aTurns on autosplit mode. Used with the -n or -p options. (Splits to @F.)
-cChecks syntax. (Does not execute program.)
-dStarts the Perl symbolic debugger.
-D numberSets debugging flags.
-e commandEnters a single line of script. Multiple -e arguments can be used to create a multiline script.
-F regexpSpecifies a regular expression to split on if -a is used.
-i[extension]Edits < > files in place.
-I[directory]Used with -P, specifies where to look for include files. The directory is prepended to @INC.
-l [octnum]Enables line-end processing on octnum.
-nAssumes a while (<>) loop around the script. Does not print lines.
-pSimilar to -n, but lines are printed.
-PExecutes the C preprocessor on the script before Perl.
-sEnables switch parsing after program name.
-SEnables PATH environment variable searching for program.
-TForces taint checking.
-uCompiles program and dumps core.
-UEnables Perl to perform unsafe operations.
-vOutputs the version of the Perl executable.
-wEnables checks and warning output for spelling errors and other error-prone constructs in the script.
-x [directory]Extracts a Perl program from input stream. Specifying directory changes to that directory before running the program.
-XDisables all warnings.
−0[octal]Designates an initial value for the record separator, $/. See also -l.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.143.3.208