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


in reply to Perl -v does not show currently installed version

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.
  • Comment on Re: Perl -v does not show currently installed version

Replies are listed 'Best First'.
Re^2: Perl -v does not show currently installed version
by ikegami (Pope) on Mar 10, 2005 at 22:37 UTC

    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