in reply to Re: ifdef in modules
in thread ifdef in modules
You're right...it does work! It looks like mine didn't work due to this (which I failed to put in my sample code...sorry):
use lib './perl5lib';
That's where I put Bar.pm. Here's the full not-working-as-expected code:
# ./foo.pl: use lib './perl5lib'; use Bar; die "outer death"; __END__ # ./perl5lib/Bar.pm: package Bar; =begin DEBUGGING die "inner death"; =cut 1; __END__
That said, I'm still not sure why this doesn't work. I'm guessing it has something to do with 'use lib' being loaded after 'ifdef', and 'ifdef' isn't able to work its magic on anything that wasn't in @INC when it was loaded.
Given the restriction that the module in question must be put in './perl5lib', can anyone offer any suggestions for workarounds?
Thanks!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: ifdef in modules
by tlm (Prior) on Jun 14, 2005 at 17:49 UTC | |
by clee (Novice) on Jun 14, 2005 at 19:50 UTC | |
|
Re^3: ifdef in modules
by tlm (Prior) on Jun 14, 2005 at 21:33 UTC | |
by clee (Novice) on Jun 15, 2005 at 00:32 UTC |