[Thread Prev][Thread Next][Thread Index]

Re: Path to Perl



Alan Harder wrote:
> 
> ouch.  resisting urge to flame.
> 
> > When I ran setup it insisted on finding Perl in /usr/dist instead of in
> > /opt/PERL even though the new version was at the front of my PATH.
> > I got around it by umounting /usr/dist. Wouldn't it be nice if it used the
> > PATH to find Perl instead of just assuming that if there's Perl in /usr/dist,
> > that's the one to use.
> 
> yes, wouldn't it be nice.. wait a minute!  it is!
> 
> echo "Locating Perl 5..."
> for cmd in perl5 perl
> do
>         for dir in `echo $PATH | sed -e 's/:/ /g'`
>         do
> 
> As you can see it is checking your PATH and there is no hardcoded "/usr/dist".
> However, it looks for "perl5" before just "perl".  This could be your problem.
> Do you have /opt/PERL/perl5?
> /usr/dist/exe/perl5 exists which is why it finds it first.


In the context of the brief code segment, why not replace it with:

for dir in `echo $PATH | sed -e 's/:/ /g'`
do
	for cmd in perl5 perl
	do

This would find the first occurance in your path of either perl5 or
perl,
v. "first, find perl5, then (if needed) find perl, in your path".


SourceForge.net Logo