in reply to Re: Problem with use lib?
in thread Problem with use lib?

See FindBin is broken (RE: How do I get the full path to the script executing?) for my thoughts on FindBin. It mostly works but it does so by spinning its wheels in the most perverse ways. The whole design is based around a false assumption. If you have Perl 5.6 or higher, I'd recommend the following:

use File::Spec; use File::Basename qw(dirname); use lib dirname( File::Spec->rel2abs($0) );
but that may be overkill since it can end up putting the full path to "." in the front of @INC, so you can probably get away nicely with:
BEGIN { use File::Basename qw(dirname); use lib dirname( $0 ); }
but be warned that doing a chdir() between this and a require could cause surprises.

        - tye (but my friends call me "Tye")