On Apr 9, 1:04 pm, alanhag...@alanhaggai.org (Alan Haggai Alavi) wrote: > > ... > > #!usr/bin/perl > > For increased portability, use the shebang #!/usr/bin/env perl >
Hm, portable only in limited situations, risky, and always slower. From: http://www.webmasterkb.com/Uwe/Forum.aspx/perl/3968/env-perl-or-simply-perl Randal Schwartz's response from above thread: ... Seconded on the "reduced portability". The shebang path has to be accurate. Throwing "env" into the mix means that env has to exist at a known location. Some systems don't have it, some system have it at /bin/env, and some systems have it at /usr/bin/env... so you're only portable within a subset of machines. Also, you're then also doing a double-launch. First, the kernel launches env, then env has to wake up and figure out where Perl is, and then launch that. And, if that wasn't enough, you risk that your script will be run by a privately installed Perl when someone else runs it... which might not have the right version or the right installed modules. An explicit #! path never depends on PATH, so that's not an issue. So, in general, avoid this strategy when you can. -- Charles DeRykus -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/