- publishing free software manuals
Perl Language Reference Manual
by Larry Wall and others
Paperback (6"x9"), 724 pages
ISBN 9781906966027
RRP £29.95 ($39.95)

Sales of this book support The Perl Foundation! Get a printed copy>>>



-M[-]'module ...'


-mmodule executes use module (); before executing your program.

-Mmodule executes use module ; before executing your program. You can use quotes to add extra code after the module name, e.g., '-Mmodule qw(foo bar)'.

If the first character after the -M or -m is a dash (-) then the 'use' is replaced with 'no'.

A little builtin syntactic sugar means you can also say -mmodule=foo,bar or -Mmodule=foo,bar as a shortcut for '-Mmodule qw(foo bar)'. This avoids the need to use quotes when importing symbols. The actual code generated by -Mmodule=foo,bar is use module split(/,/,q{foo,bar}). Note that the = form removes the distinction between -m and -M.

A consequence of this is that -MFoo=number never does a version check (unless Foo::import() itself is set up to do a version check, which could happen for example if Foo inherits from Exporter.)

ISBN 9781906966027Perl Language Reference ManualSee the print edition