BEGIN {unshift @INC, "/directory/where/you/put/it"}
The unshift puts the new directory at the beginning of the list, so it'll find that one first.
Alternatively, you can invoke perl with the -I option, which adds to the beginning of @INC.
Or you can use lib like you are doing, which also adds the path to the start of the list. This is normally the best way if you just have a simple directory path to add.
So, why doesn't it work for you? Are you sure you are specifying the directory containing the XML directory, not the XML directory itself? It adds XML/Parser.pm to each directory in the path.
no subject
Date: 2008-01-02 11:18 am (UTC)BEGIN {unshift @INC, "/directory/where/you/put/it"}
The unshift puts the new directory at the beginning of the list, so it'll find that one first.
Alternatively, you can invoke perl with the -I option, which adds to the beginning of @INC.
Or you can use lib like you are doing, which also adds the path to the start of the list. This is normally the best way if you just have a simple directory path to add.
So, why doesn't it work for you? Are you sure you are specifying the directory containing the XML directory, not the XML directory itself? It adds XML/Parser.pm to each directory in the path.