in reply to ifdef in modules
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: ifdef in modules
by clee (Novice) on Jun 14, 2005 at 16:54 UTC | |
by Tanktalus (Canon) on Jun 14, 2005 at 20:12 UTC | |
by clee (Novice) on Jun 14, 2005 at 21:44 UTC | |
by Tanktalus (Canon) on Jun 14, 2005 at 22:11 UTC | |
by clee (Novice) on Jun 15, 2005 at 00:27 UTC | |
|