> When I write my perl scripts on UNIX, the first line I would usually put: > #!/usr/bin/perl
On Unix this type of line at the start of a script tells the system which shell to use. Perl just uses the same mechanism on Unix to tell the system that this is a perl script. VMS doesn't have such a mechanism. Hence in VMS such a line is just treated as a comment. People still tend to put them in so that if the code is later moved to a Unix system it will be in the standard format. ON VMS you need to explicitly type PERL scriptname to get it to run the script through PERL. (webserver perl CGIs are a special case since they either do this transparenly for you or run a persistent perl intepreter (usually written in C ) which executes the perl script for you.) When you install PERL there is a file PERL_SETUP.COM created which you should run (eg @perl_root:[000000]perl_setup.com ) to setup the PERL command (and other commands such as PERLDOC). > Stating that that's where to find the perl binary to run the script, and so > I can just type "perl_script" instead of "perl perl_script" to run it. > Can someone shed me some light on how to do that on VMS? You can't do that directly since VMS doesn''t know how to run PERL without seeing the PERL command. You could I suppose put the perl_script in an enclosing DCL command file eg perlscript.com containing something like $perl perlscript.pl $exit And then define dcl$path to include the directory containing the perlscript.com commandfile. DCL$PATH is similar to the unix path and allows you to run any .com or .exe programs without having to type RUN , @ or setup any symbols. Personally I think that is too much trouble - simpler just to type PERL before the scriptname. > Again, I don't know anything about VMS and right now the way I even get > "perl" to be recognized as a command is by typing: > PERL :== $PERL_ROOT:[000000]PERL.EXE > and then I can start typing "perl perl_script" to run stuff. > In addition, how do I turn that perl script into a command? on Unix I'd > just do chmod 755 perl_script All chmod 755 does is change the file protection so that anyone can read and execute the script. The equivalent on VMS would be set file/prot=(s:rwed,o:rwed,g:re,w:re) perl_script.pl/log Though whether you want anyone other than yourself running the perl script is another question ie on UNIX do you really want to do chmod 755 or are you just doing that because someone told you that is the command to use. If you just want to run the file yourself (and be able to edit it etc) you would probably be better to use chmod 700. The equivalent on VMS being set file/prot=(s:rwed,o:rwed,g,w) perl_script.pl/log Though this may well be the default the file was created with anyway. ie On VMS you probably don't need to do any of this if you just want to execute the perl script yourself you probably just need to type PERL perlscript.pl David Webb VMS and Unix team leader CCSS Middlesex University > Thanks for all the help! > Patrick
