<?xml version="1.0" encoding="windows-1252"?>
<node id="897028" title="Calling the correct perl binary" created="2011-04-01 19:22:20" updated="2011-04-01 19:22:20">
<type id="120">
perlmeditation</type>
<author id="890813">
cavac</author>
<data>
<field name="doctext">
&lt;p&gt;&lt;i&gt;Note: I didn't write this post to start a flame war or to discredit anyone. What i like to see is some active discussion on the topic&lt;/i&gt;&lt;/p&gt;
&lt;p&gt;On most of my (linux) systems, i usually have at least two perl binaries installed:&lt;/p&gt;

&lt;p&gt;
&lt;ul&gt;
&lt;li&gt;Whatever comes with the linux distribution, usually at /usr/bin/perl&lt;/li&gt;
&lt;li&gt;The one that i use. That's the one a call to "perl" starts in *my* user account&lt;/li&gt;
&lt;/ul&gt;
&lt;/p&gt;

&lt;p&gt;In the past - when using the OS supplied perl - i had some major troubles. Mostly, these where incompatibilities after the distributor rolled out some updates or when i upgraded some modules to newer (test) versions. Also, now i use ActiveState Perl for much of my software development.&lt;/p&gt;

&lt;p&gt;The trouble is: While the distribution-supplied scripts correctly call /usr/bin/perl, most of the code that i download from the interwebs does so too - and start breaking because of "missing" modules&lt;/p&gt;

&lt;p&gt;The thing that worked for me best is to change all Perl scripts on my system to use &lt;br&gt;&lt;code&gt;#!/usr/bin/env perl&lt;/code&gt;&lt;br&gt; as the hashbang line. Whenever the systems automatically start a Perl script, it uses the dristribution-maintained perl, whenever i start a script with my user account, it uses the perl installed in my home directory.&lt;/p&gt;

&lt;p&gt;In my opinion, in a time where there are more and more different plattforms, assuming perl is at a fixed path and that perl binary is the correct one to use isn't very helpfull. It's similar to the still widely spread believe that /bin/sh is bash (or csh or whatever)...&lt;/p&gt; </field>
</data>
</node>
