in reply to Upgraded perl but cant get to the new version

When you do a command like this:

$ command

Then the system looks at the diretories in you path and executes the first matching one. To see your path do:

$ echo $PATH /bin:/sbin:/usr/bin:/usr/sbin: $

In this case we have 4 dirs in the PATH. The OS will look for 'command' in /bin, then /sbin....etc until it finds an exe called 'command' If there is one in /bin it will never look any further.

You are seeing the result of this behaviour. You will have (prabably a symlink) to 'perl' in /usr/bin so that is the first one found, and the one that gets executed when you ask for perl. If you do '/usr/local/bin/perl' (probable install location) you will get 5.8. Either call 5.8 on the shebang line as shown or replace the symlink in /usr/bin.....

To find all the perls on your system do:

$ locate -u $ locate bin/perl /usr/bin/perl /usr/local/bin/perl $
The -u flag to locate updates the DB (may take a minute, background with &, add a daily cron job...) and then we run it to find all the things on the system that match the search string.

cheers

tachyon

s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print

Replies are listed 'Best First'.
Re: Re: Upgraded perl but cant get to the new version
by barrd (Canon) on Oct 05, 2003 at 14:31 UTC
    Hi tachyon,
    The -u flag to locate updates the DB...
    Not trying to be a SA here but the -u flag for locate isn't applicable to all *nix's (in my case Debian). I have to use the updatedb command instead.

    Not an attack, just an observation and "heads up" if anyone attempting it gets the good ole 'locate: invalid option -- u' error message.

      Sure, but AM specified did specify RH 7.2 where it is certainly valid.

      cheers

      tachyon

      s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print