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

Re: Path to Perl



As we are currently using British Summer Time (BST) here in the UK I
have been struggling to find a solution to the timezone "bug". I
found that setting the TZ variable to GMT-1 simply knocked all my
appointments out by one hour and setting it to BST did the same
(sometimes - but I'm not sure of the exact details). I installed a
newer version of Perl on my machine and reinstalled PilotManager.
PilotManager insisted on finding the old version of Perl in /usr/dist
rather than my new installation which was at the head of the path.

I checked to make sure that 'which perl' returned /opt/PERL/bin/perl
and it did. I just took a look at the setup script and found that it
looks for perl5 first and then perl. I didn't have a perl5 in
/opt/PERL/bin, just perl. As I don't know anything about perl I don't
have any idea why it would do that.

Perhaps it might make more sense for the Setup script to look for
perl5 and perl in each directory in the path as in the attatched
script snippet, rather than looking for perl5 in each directory in
the path and then looking for perl in each directory.

I totally agree with Darren that it's about time that we had a new
version of Perl installed in /usr/dist. How do we go about getting
that done? Is anyone from ENS listening?

I've now got everything working and I know how I can modify the Setup
script so I can install it for the salesmen and everyone else here
in the City office.

Thanks for all your replies

Al...

Alistair G.C. Stewart
Senior Systems Engineer
-------------------------------------------------------------------
Sun Microsystems Ltd                Tel   : +44 (0)171 628 3000
8/9th Floor, Ropemaker Place        Fax   : +44 (0)171 628 2240
25 Ropemaker Street                 Direct: +44 (0)171 614 8236
London  EC2Y 9AS                    mobile: +44 (0)411 053 825
===================================================================

Alan Harder wrote:
> 
> ouch.  resisting urge to flame.
> ...
> As you can see it is checking your PATH and there is no hardcoded "/usr/dist".
> However, it looks for "perl5" before just "perl".

Alan Harder wrote:
> do I dare ask what this means?
> I hope you read the daylight savings faq.

Robert E.Novak wrote:
> Try the attached script which I use...

Robert E.Novak wrote:
> 
> Just out of curiosity, what does 'which perl' return when you set up the path?
> 

Douglas Fallstrom wrote:
> 
> Well, a quick and dirty fix is to edit the perl files to point to your
> "exported?" installation of /usr/dist  :)

Darren J Moffat wrote:
> I think it is time that we convinced ENS to install a new release
> of Perl in /usr/dist and at the same time to install PilotManager.
> 
> There are enough people in Sun with Pilots now that I think this would
> be justified.
> 
> --
> Darren J Moffat

I wrote:
> I finally gave in after losing too many appointments because of this
> daylight savings "feature". I downloaded and installed a new version
> of Perl on my machine in /opt/PERL. I then wiped my pilotmgr directory
> and downloaded the whole thing again and installed it.
>
> 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.
>
> How am I going to do this for all the salesmen in the office here as I
> don't know the root password on their systems so I can't unmount
> /usr/dist on their systems.
>
>Al...
>rant, rant, grumble, grumble ... Stomps off home to annoy the cat.
echo "Locating Perl 5..."
for dir in `echo $PATH | sed -e 's/:/ /g'`
do
        if [ -n "$dir" -a -x "$dir/$cmd" ]
        then

                for cmd in perl5 perl
                do
                        MAYBE=`$dir/$cmd -e 'print $^X'`

                        if [ "$MAYBE" != "" ]
                        then
                                `$MAYBE  -e "eval{require $VERS}; \
                                            exit 0 if \\$@; exit 1"`
                        fi

                        if [ $? -eq 1 ]
                        then
                                PERL=$MAYBE
                                break 2
                        fi
                done
        fi
done

SourceForge.net Logo