in reply to Runtime use of "use lib <xxx>"

The simplest method of modifying @INC at runtime has been mentioned; it is, after all, just an array.

If you want all of the semantics of use lib at runtime you can also use:

use lib; ...; lib->import($path);

I occasionally use this idiom with use base.

Replies are listed 'Best First'.
Re: Re: Runtime use of "use lib <xxx>"
by datalas (Novice) on May 20, 2004 at 10:30 UTC
    Cheers for that, I had kinda guessed at pushing things onto the @INC array, but sadly can't test it too easily at the moment (need to get someone to write a "module" really).

    The main reason I asked was that the local PerlMonkey (tm) declared that @INC was only evaluated at compile time so would therefore negate what I was trying to do.

    I shall go and give him a jolly good slap :)