The stupid question is the question not asked | |
PerlMonks |
Re: A Perl Environmentby meetraz (Hermit) |
on Mar 04, 2003 at 23:05 UTC ( [id://240477]=note: print w/replies, xml ) | Need Help?? |
Once you have perl set up on Windows, there are a few tricks you can use to make it easier to execute them. Normally, on unix & windows, you can execute a perl script like this: 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 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 Section
Seekers of Perl Wisdom
|
|