The limitation is not ifdef's, but -M's. use is block/file scoped. -M is the same thing as use at the top of the input file, therefore -M won't affect the module.
bla.pl ------ BEGIN { $|=1 } use bla (); $planet = "World\n"; print($planet); bla.pm ------ $greet = "Hello\n"; print($greet); >perl -Mstrict bla.pl Hello Global symbol "$planet" requires explicit package name at bla.pl line +3. Global symbol "$planet" requires explicit package name at bla.pl line +4. Execution of bla.pl aborted due to compilation errors.
As you can see, strict did not affect the module.
In reply to Re: ifdef in modules
by ikegami
in thread ifdef in modules
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |