in reply to Re^4: ifdef in modules
in thread ifdef in modules
Ignorance? I'm just figuring this stuff out now, too :-)
1 - correct. Specifically, at the front of @INC.
2 - correct. Specifically, at the front of @INC (in front of the handler that ifdef put in)
2.1 - when the module is loaded, perl looks at @INC, finds perl5lib, finds the file there, loads it, and compiles it. During that compilation, it sees...
3 - incorrect. It sees the use ifdef, but doesn't reload ifdef (it's already loaded). It does, however, call ifdef->import(). This action turns around, figures out what ifdef parameter was passed on the original commandline (it's stored in an environment variable), and then calls the source filter on your code immediately. Once the source filter is done, perl continues parsing and compiling the rest of your module.
So, actually, it's not as convoluted as you may have thought. ;-) It does seem very convoluted, though.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: ifdef in modules
by clee (Novice) on Jun 15, 2005 at 00:27 UTC | |
by Tanktalus (Canon) on Jun 15, 2005 at 02:32 UTC | |
by clee (Novice) on Jun 15, 2005 at 17:07 UTC |