Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: A Perl Environment

by meetraz (Hermit)
on Mar 04, 2003 at 23:05 UTC ( [id://240477]=note: print w/replies, xml ) Need Help??


in reply to A Perl Environment

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
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.

Replies are listed 'Best First'.
Re: Re: A Perl Environment
by Nkuvu (Priest) on Mar 05, 2003 at 04:50 UTC
    If I recall correctly the ActiveState installer does a lot of this for you. I think I had to add the .pl to the PATHEXT, but the rest was done automagically. Just a FYI. And, um, a not-100%-sure FYI at that...

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://240477]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (3)
As of 2024-04-24 20:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found