O'Reilly logo

Perl Pocket Reference, 5th Edition by Johan Vromans

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Appendix A. Command-Line Options

--

Stops processing options.

-0 [ octnum ]

(That’s the number zero.) Designates an initial octal value for the record separator $/. See also -l on the following page.

-a

Turns on autosplit mode when used with -n or -p. Splits to @F.

-c

Checks syntax but does not execute. It does, however, run BEGIN, CHECK, and UNITCHECK blocks.

-C [ number / list ]

Controls some of the Perl Unicode features.

-d[ t ] [ :module ] [ =arg [ ,arg... ] ]

Runs the script under the indicated module. With -dt enable threads. Default module is the Perl debugger. Use -de 0 to start the debugger without a script.

-D flags

Sets debugging flags.

-e commandline

May be used to enter a single line of script. Multiple -e commands build up a multiline script.

-E

Same as -e, but implicitly enables all optional features. See the section Pragmatic Modules.

-F pat

Specifies a pattern on which to split if -a is in effect.

-h

Prints the Perl usage summary. Does not execute.

-i [ ext ]

Activates in-place editing for files processed by the < > construct.

-I dir

The directory is prepended to the search path for Perl modules, @INC.

-l [ octnum ]

(That’s the letter el.) Enables automatic line ending processing, e.g., -l013.

-m[-]module [ =arg [ , arg... ] ]
-M[-]module [ =arg [ , arg... ] ]

Does a use module before executing the script.

With - does a no module instead.

Without arguments, -M imports the default set and -m imports nothing.

Otherwise, the arguments are passed to the module’s import method.

-n

Assumes an input loop ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required