in reply to defined weirdness
The perceived weirdness is not with defined, but a side effect of how use works.
Basically, use works at compile time, while your if statement is a runtime thing. The documentation for use also shows you what to do to import modules at runtime:
if( ... ) { require Module; Module->import( ... ); };
|
|---|