Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: How to run perl5.21.3 as "perl"

by ikegami (Pope)
on Aug 18, 2014 at 22:01 UTC ( #1097912=note: print w/ replies, xml ) Need Help??


in reply to How to run perl5.21.3 as "perl"

which is a utility rather than a shell command in sh and sh-derived shells. As such, it knows nothing of the shell's aliases and such. It just searches the path.

To find out what bash will execute when you type perl, use type perl. It will tell you if it's an alias. It will tell you if it's "hashed", which is to say cached. The cache can be cleared using hash -r.

Update: Added "in sh and sh-derived shells".


Comment on Re: How to run perl5.21.3 as "perl"
Select or Download Code
Re^2: How to run perl5.21.3 as "perl"
by tobyink (Abbot) on Aug 19, 2014 at 00:38 UTC

    bash doesn't have a built-in which? tcsh does, which is quite handy...

    $ which perl /home/tai/perl5/perlbrew/perls/perl-5.20.0/bin/perl $ which ls ls: aliased to ls --color=tty $ which which which: shell built-in command.

      You seem to have stopped reading my post before the second paragraph. The whole point of my post was to show how to do what tcsh's which does.

      $ type perl perl is /home/ikegami/usr/perlbrew/perls/5.20.0t/bin/perl $ perl -e1 $ type perl perl is hashed (/home/ikegami/usr/perlbrew/perls/5.20.0t/bin/perl) $ type ls ls is aliased to `ls -F -1 --color=auto' $ type type type is a shell builtin

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1097912]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (11)
As of 2014-12-27 17:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (177 votes), past polls