#! and Quoting on Non-Unix Systems
Unix’s #! technique can be simulated on other systems:
- MS-DOS
Create a batch file to run your program, and codify it in
ALTERNATIVE_SHEBANG. See the dosish.h file in the top level of the Perl source distribution for more information about this.- OS/2
Put this line:
extproc perl –S –your_switches
as the first line in *.cmd file (–S works around a bug in cmd.exe’s “
extproc” handling).- VMS
Put these lines:
% perl –mysw 'f$env("procedure")' 'p1' 'p2' 'p3' 'p4' 'p5' 'p6' 'p7' 'p8' !$exit++ + ++$status != 0 and $exit = $status = undef;at the top of your program, where
–mysware any command-line switches you want to pass to Perl. You can now invoke the program directly by typingperl program, as a DCL procedure by saying@program, or implicitly viaDCL$PATHby using just the name of the program. This incantation is a bit much to remember, but Perl will display it for you if you type inperl "–V:startperl". If you can’t remember that—well, that’s why you bought this book.- Windows
When using the ActiveState distribution of Perl under some variant of Microsoft’s Windows suite of operating systems (that is, Win95, Win98, Win00,[172] WinNT, but not Win3.1), the installation procedure for Perl modifies the Windows Registry to associate the .pl extension with the Perl interpreter.
If you install another port of Perl, including the one in the Win32 directory of the Perl distribution, then you’ll have to modify the Windows Registry yourself.
Note that using a .pl extension ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access