[Thread Prev][Thread Next][Thread Index]
Re: Path to Perl
- To: Pilot Manager Discussion <pilotmgr@xxxxxxxxxxxxxxxxxxxxx>
- Subject: Re: Path to Perl
- From: Jim Koelkebeck <Jim.Koelkebeck@East>
- Date: Thu, 14 May 1998 14:57:11 -0400
- Cc: Alan Harder <Alan.Harder@Corp>
- Organization: Sun Microsystems
- References: <199805141817.LAA29882@moshpit.Corp.Sun.COM>
- Sender: koke@East
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".