Michael G Schwern wrote:
> Here it is much simpler, and going onto the front of @INC as it should.
>
> use File::Spec;
> BEGIN {
> unshift @INC, map { File::Spec->rel2abs($_) } "t/lib";
> }
>
> If I had to write all that code in every test I'd strangle myself.
> Fortunately there's lib::abs which I'd thought I'd mentioned but must have
> left it out. It handles all this for you. Though looking at the code it goes
> through WAY more trouble than it should.
I take it back. lib::abs is misleading. It doesn't just turn relative lib
paths absolute as the name implies, it makes them absolute *to the location of
the current file* not the current working directory.
use lib File::Spec->rel2abs($dir);
and
use lib::abs $dir;
are not equivalent as I thought.
--
10. Not allowed to purchase anyone's soul on government time.
-- The 213 Things Skippy Is No Longer Allowed To Do In The U.S. Army
http://skippyslist.com/list/