Perl shebang for different versions
In a Perl script typically a shebang line is something like:
this works great if you want to use a wide, system based, Perl for your scripts. But what if you have several different installations of Perl and want to run the same script using different Perl versions without having to change the shebang line. Well, one possible and straightforward solution is to change it to something like:
and then push the version you want to use to your $PATH environment variable. This can even be easily done based on the user. For example, you can have a user named 'perl_5.10' and for that user have:
now, this user runs scripts (with the env version of the shebang line) using Perl 5.10.