develooper Front page | perl.perl5.porters | Postings from May 2003

Re: [perl #22209] Test::Harness::Straps vs. $Config{path_sep}

Thread Previous
From:
Michael G Schwern
Date:
May 16, 2003 16:40
Subject:
Re: [perl #22209] Test::Harness::Straps vs. $Config{path_sep}
Message ID:
20030516234003.GG26852@windhund.schwern.org
On Fri, May 16, 2003 at 03:19:57PM -0400, Rick Delaney wrote:
> > My::Module would not be found if it was in blib/lib because of the relative
> > directory on @INC.  The new MakeMaker uses an absolute path, which now
> > includes your /tmp/A:B/.
> 
> Is there any reason to not also include the relative paths?
> (Patch on 5.8.0).

Because you might accidentally wind up loading something you didn't
expect because you chdir'd somewhere that also has a blib/lib.  Yes, this
is an edge case, but I don't like to solve an edge case by breaking another.

And because its a very unsavory hack.  MakeMaker has more than its share
of those.


> --- lib/ExtUtils/Command/MM.pm.orig	Fri May 16 14:56:53 2003
> +++ lib/ExtUtils/Command/MM.pm	Fri May 16 14:57:12 2003
> @@ -50,7 +50,9 @@
>      $Test::Harness::verbose = shift;
>  
>      local @INC = @INC;
> -    unshift @INC, map { File::Spec->rel2abs($_) } @_;
> +    unshift @INC, map { File::Spec->file_name_is_absolute($_) 
> +                            ? ($_)
> +                            : ($_, File::Spec->rel2abs($_)) } @_;
>      Test::Harness::runtests(sort { lc $a cmp lc $b } @ARGV);
>  }

-- 
I knew right away that my sock and your eyebrows could be best friends.

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About