Re: $^X rather than $Config{perlpath}
Roderick Schertler (roderick@argon.org)
Mon, 12 Apr 1999 09:44:41 -0400
On 12 Apr 1999 13:37:46 +0200, Gisle Aas <gisle@aas.no> said:
>
> I was under the impression that you can't trust $^X (not always an
> absolute path when that is what you need). Am I wrong?
In absolute terms you can't trust it because people are free to specify
argv[0] as whatever they like. For practical purposes, you can trust
it. I believe all normal shells will put the correct path there. I
believe this even stronger for all versions of sh, which is what is
being used when the user runs "make test". It might or might not be
absolute, but it will be correct no matter what.
I can't speak for non-Unix systems.
> If $Config{'perlpath'} is wrong, than your perl installation is bad
> (or you have not installed your perl yet).
This isn't so if you've got multiple versions of Perl installed. The
default value for this is /usr/local/bin/perl, it isn't versioned. The
user might have run perl5.00503 or perl5.00404 instead of perl, in which
case $^X is right but $Config{perlpath} isn't. This is particularly
important now that $Config{sitelib} _is_ versioned. The user who uses
the defaults will have to re-install the module for each version of
Perl, so using $Config{perlpath} is these days even more likely to cause
problems.
--
Roderick Schertler
roderick@argon.org