[Canberra-pm] /usr/bin/env (was Re: Still podding around)

Daniel Pittman daniel at rimspace.net
Thu Aug 7 03:00:03 PDT 2008


Stephen Steneker <stephen at sydney.pm.org> writes:

[...]

> You may also want to try changing your shebang from hardcoded path:
>    #!/usr/bin/perl -w
>
> to using the default perl in your env (i.e. the equivalent of `which perl`):
>    #!/usr/bin/env perl -w

Just for reference, this isn't any better a solution to providing a
portable "use the default Perl" than the previous statement: some
operating systems only provide /bin/env, which makes it also fail...

It does, as noted, ensure that if your admin has installed multiple
versions of Perl it will pick the same default as running the command
interactively -- which, also, may not be the "system default" perl if
the path is not set in, eg, the environment of a cron job.

Regards,
        Daniel


More information about the Canberra-pm mailing list