in reply to #!perl Question

You need to specifyt the full path to perl, since $ENV{PATH} isn't used in this circumstance. You could use #!/usr/bin/env perl to search using $ENV{PATH}. (Note: I hear that path to env (/usr/bin) is not the same on all systems, rendering it somewhat useless.)

Update: Clarified to avoid confusion of between a file's path and the environment variable.

Replies are listed 'Best First'.
Re^2: #!perl Question
by itub (Priest) on Oct 03, 2005 at 18:52 UTC
    Then we just need a program called "envfinder" to find the path to "env":

    #!/usr/bin/envfinder env perl

    And if you want to make sure that it works even in systems that put envfinder in nonstandard locations:

    #!/usr/bin/envfinderfinder envfinder env perl

Re^2: #!perl Question
by perrin (Chancellor) on Oct 03, 2005 at 18:18 UTC
    That's what I use and it has worked on Red Hat and Debian systems with no trouble.
Re^2: #!perl Question
by thor (Priest) on Oct 03, 2005 at 18:19 UTC
    Note: I hear that env's path is not the same on all systems, rendering it somewhat useless.
    From what I understand, env uses your own environment, so if your $PATH is different between systems, env's notion of it will be different, too.

    thor

    Feel the white light, the light within
    Be your own disciple, fan the sparks of will
    For all of us waiting, your kingdom will come

      I was refering to the path to env (/usr/bin), not the environment variable.
        Thank you all for the insight. SOLUTION : Since I am running my scripts from a filer that has OS specific mounts for each machine. I think I will just use perl from there. ( /Net/filer/$OS/local/bin/perl) Seems to work just fine!