Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

Re^2: Calling the correct perl binary

by cavac (Deacon)
on Apr 04, 2011 at 00:08 UTC ( #897259=note: print w/replies, xml ) Need Help??

in reply to Re: Calling the correct perl binary
in thread Calling the correct perl binary

I'm aware that the env "trick" isn't completly portable. But neither is assuming that perl is available under /usr/bin/perl. Not when so many new plattforms/operating systems enter the market these days. There are probably hundreds of companies and lonely geeks out there hacking some new, cool operating systems for their future tablets, smart(er) phones, e-book readers, industrial robots... and probably some cool gadgets not yet officially invented.

I think you miss my point. By essentially hardcoding which perl to use, you take away many possibilities. Like having a user run/test all the scripts with a different perl binary.

Of course, the user could alway call /mypath/perl But that's not always possible. Especially if - say for example - a bash script starts the Perl script. And yes, you could always rewrite the scripts and such. To me, it makes more sense to just set some environment variables *once* and let the system to the actual work.

And.. another yes, most of my scripts run well on both on the system perl as well as "my own" (but i wont risk it on production systems). Testing is easy enough, i just run a bash script that changes the environment variables and i can test all of my Perl scripts on all of my installes perl binaries - without rewriting them.

So, sorry for the rant, but there currently is no 100% portable way to implement calling the correct binary for perl. But hardcoding the full path to which perl binary to use is - in my opinion - even less helpfull.

Don't use '#ff0000':
use Acme::AutoColor; my $redcolor = RED();
All colors subject to change without notice.

Replies are listed 'Best First'.
Re^3: Calling the correct perl binary
by JavaFan (Canon) on Apr 04, 2011 at 06:15 UTC
    But hardcoding the full path to which perl binary to use is - in my opinion - even less helpfull.
    And your solution is to replace it with another hardcoded path?

    What makes you think that those new, cool platforms you are referring to have an env, and it's in the location you presume it is? I mean, if they deliver their new, cool platform, with a perl, not in /usr/bin, but elsewhere in $PATH, they may as well have env elsewhere as well.

    You seem to have a perceived problem, which you are fixing with a solution that suffers from exactly the same potential problem.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://897259]
[Tanktalus]: hmm, no, the mech object for posting isn't the same as reading, but it's the same as the logging in one.
[Tanktalus]: I really need to rewrite this whole thing anyway. :)

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (6)
As of 2018-07-15 21:42 GMT
Find Nodes?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?

    Results (326 votes). Check out past polls.