How the -m switch works in Perl

If you could explain the flow and how / why we can create a module for working with -Mm, this will be useful

+5
source share
1 answer

-Mfoojust generates the code use foo;and puts it at the beginning of the compiled code.

-Mfoo generates use foo ();

-Mfoo=bar,bazgenerates use foo ('bar','baz');, and therefore -Mfoo=bar,baz- that is, there is no longer a difference between -Mand -M, when you use a form with an equal sign, but without it -Mgenerates a "non-import" form use.

This is all documented in perlrun .

+19
source

All Articles