Chapter 2. 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 below.


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


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


Uses native wide-character system APIs, if supported by the system.

-d [ :module ]

Runs the script under the indicated module. 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 may be given to build up a multiline script.

-F pat

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


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. Combined with -P, -I also tells the C preprocessor where to look for include files.

-l [ octnum ]

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

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

See -M on the facing page.

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

Does a use module before executing the script. With - does a no module instead.


Assumes an input loop around the script. Lines are not printed.


Assumes an input loop around the script. Lines are printed.


Runs the C preprocessor on the script before compilation by Perl.


Interprets ...

Get Perl Pocket Reference, 4th Edition now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.