laziness, impatience, and hubris | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
It doesn't work due to how BEGIN blocks and use statements are compiled/executed. If you take the use out of the equation, you can see that there's nothing special about %INC:
For example, compare the difference between these two commands: perl -e'BEGIN{ eval "use Net::FTP;" } print %INC' and perl -e'BEGIN{ local %INC = %INC; eval "use Net::FTP;" } print %INC' The only difference between the two is the localization of %INC in the BEGIN block. Of course, doing an eval on the string is slow. The OP might want to use a require inside a BEGIN block, instead:
In reply to Re^2: How can I prevent a module from being added to the %INC hash?
by ammon
|
|