Perl across OS' (The Shebang)
The shebang line is the first line of the Perl script denoted by the #! which is the first two characters on the first line of the program which specifies the path to the script's interpreter, in the case of Perl it specifies the path to the Perl executable (interpreter). Perl has been successfully ported to Windows and is available in various flavors, e.g. Vanilla Perl, Strawberry Perl, Chocolate Perl and ActiveState Perl. This is the necessary newbie intro, now for the actual topic...
The shebang line really presents a problem when developers using Windows collaborate on scripts with non-Windows developers. All Perl scripts that are executed indirectly will (should) have a shebang line. Most Perl hackers code in a Linux (-like) environment which means their shebang line will look something like this:
Windows Perl hackers shebang line would look something like this:
As you can see, this would present a problem if the Linux Perl hacker sent me (using Windows) the script, or more commonly, I fetched the script from a version control repository, updated the script using my shebang, made some modifications, then pushed the changes back to the repo only for the Linux user to have to repeat the same pattern.
The answer is a little know hack for WIndows whereby the path to Perl is mocked under the Windows file system by copying the Perl installation to a `usr` folder in the root drive's folder, e.g. copy C:\Perl to C:\usr:
Now, #!/usr/bin/perl in the script is treated the same as #!C:/usr/bin/perl.exe. The only problem with this is that when modules are updated or installed using CPAN, the copied instance of Perl is not updated, so instead of re-copying your Perl installation each time you update or install a new module, instead make a symbolic link. Wait, how do you create a symbolic link with Windows, why the same way you do in Linux, with one exception. First you need GNUWin32 (http://gnuwin32.sourceforge.net/), this will give you tools like grep, find, ls and what we want, ln.
ln -s C:\strawberry\perl\ usr
We just created a symbolic link to our Strawberry Perl installation. With the aid of GNUWin32, we now have a psuedo-Linux-like Perl programming environment armed and ready.