in reply to Adding to or changing @INC

use lib

Update: This is better than simply adding to @INC for a couple of pretty obscure reasons that I had to look up: use lib does some magic with architecture specific directories, and it saves off the original @INC for you in case you need it later.

Replies are listed 'Best First'.
Re (tilly) 2: @INC
by tilly (Archbishop) on Jul 26, 2001 at 07:00 UTC
    Most people will notice a less obscure benefit. lib does its thing at compile time, which means that the change to @INC happens before other modules load. Otherwise you need to use a BEGIN block.