perl myscript.pl
On Unix, if you don't want to type the "perl" part anymore, you just add a "shebang" line like "#!/usr/bin/perl" to the top of your file, mark the file as executable (chmod u+x myscript.pl) and then you can execute it like this:
myscript.pl
But this won't work on NT. Here's how to accomplish something similar:
ASSOC .pl=PerlScript
FTYPE PerlScript=perl.exe %1 %*
Now you can execute your scripts without first typing "perl" just like on unix.
You can also one step further. There is a system environment variable called "PATHEXT". Go get to it, right-click on "My Computer", select "properties", then click "Advanced", then "Environment Variables" (Might be different for NT). Find the "PATHEXT" variable under the system section, and add ".PL" to it. Now, no matter where you are on your system, if your script is in the path, you can call it like this:
myscript
So now even though its called "myscript.pl" it works just like a ".exe" or ".com" file - you don't need to specify the extension, and you can call any perl script in your path from anywhere on the system.
In reply to Re: A Perl Environment
by meetraz
in thread A Perl Environment
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |