http://www.perlmonks.org?node_id=438405

GoCool has asked for the wisdom of the Perl Monks concerning the following question:

This node falls below the community's threshold of quality. You may see it by logging in.
  • Comment on Perl -v does not show currently installed version

Replies are listed 'Best First'.
Re: Perl -v does not show currently installed version
by mpeters (Chaplain) on Mar 10, 2005 at 20:19 UTC
    You have another version of perl that your shell is seeing first. type which perl to find out which one your shell finds first and it's probably a symbolic link. Just point it to you new perl (I think by default, '/usr/bin/perl')
    A reply falls below the community's threshold of quality. You may see it by logging in.
Re: Perl -v does not show currently installed version
by chas (Priest) on Mar 10, 2005 at 20:21 UTC
    If you find the real executable for the new perl, and execute that with option -v (or -V) you should see the expected info for that version. The actual executables may be named perl5.8.5 and perl5.8.6 and someone made a soft link so that perl referred to the original version. You can, of course, make a new such link. (It's possible that something else is going on, but I'll bet the aforementioned is the situation.)
    chas
    (Update: I notice that your original question no longer appears - it seems to have changed into the same thing as your first reply to one of the answers. This may confuse people looking at this thread...
    It is possible that the new perl version is in a location that is not in your path. In any case, you can just use the new version by calling the executable explicitly. You could also make a soft link to the new version and make sure it is in your path. (Are you really sure there isn't such a link *somewhere* in your path already?)
      Sorry to have overwritten the original question with my reply. Setting the path in .bash_profile fixed the problem , thanks everyone. Gokul
Re: Perl -v does not show currently installed version
by nerfherder (Monk) on Mar 10, 2005 at 21:13 UTC
    Try a 'man which' (if you're hungry like that...)

    The man page for 'which' claims that it searches the PATH environment variable using the same algorithm as 'bash'. However, it appears that 'which' searches the directories listed in PATH from left to right, while bash searches from right to left. Doh!

    Anyway, try exporting PATH with your /usr/bin: before your /usr/local/bin: OR switch the locations of the 2 binaries.

      My bash searches left to right. It would be really odd (and would break things) if it did it the other way (as it did here).

      $ bash --version GNU bash, version 2.05b.0(1)-release (i386-portbld-freebsd4.8) Copyright (C) 2002 Free Software Foundation, Inc. $ uname -a FreeBSD XXXXX 4.10-RELEASE FreeBSD 4.10-RELEASE #0: Wed Jun 23 03:28:0 +1 EST 2004 root@XXXXX:/usr/src/sys/compile/LILLY i386