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

Hi Monks, I am using some perl scripts here at work in conjunction with another site. The users at the other site have written the scripts and invoke them with the top line of: #!/usr/local/bin/perl. However, at our site, we use perl from /usr/bin. We want to come up with a consistent way of using the same scripts with no modifications what so ever. Is there a way to do this? I know you can invoke the script by putting the version you want in front of it, but this requires modifications, and not very helpful, as in the following case: /usr/bin/perl myscript.pl . Is there some sort of environment variable or something we can use to say where our perl executable is located? Thanks for the help! Randy

Replies are listed 'Best First'.
Re: Perl executable location differences
by sschneid (Deacon) on Oct 10, 2002 at 17:19 UTC
    This was just covered a few days ago here -- might want to check it out, lots of different solutions for your problem.

    scott.

    edited: Sat Oct 12 17:03:21 2002 by jeffa - changed abs link to [id://id|alt]

      Please don't write absolute URL links to PerlMonks content. I browse the site using www.perlmonks.org for example, so I have no cookie set for the perlmonks.org host your link points to. Consequently, it appears to log me out when I follow it. Please see What shortcuts can I use for linking to other information?

      Makeshifts last the longest.

      Thanks Scott, that's exactly what I was looking for.
Re: Perl executable location differences
by mikeirw (Pilgrim) on Oct 10, 2002 at 17:22 UTC

    Assuming you're on a UNIX machine, you can always set up a symbolic link like so:

    ln -s /usr/bin/perl /usr/local/bin/perl