On an NT/2k machine, go to the command prompt and type the following:

assoc .pl=Perl
ftype Perl=C:\Perl\Bin\Perl.exe %1 %*

        After this has been done, you no longer have to type "Perl Perlfile.pl".
However, if you don't want to type the .pl either, i.e. "PerlFile" rather than
"PerlFile.pl", then modify the PATHEXT variable.  This is done a little
differently in NT as opposed to Win 2k.  It's basically in the same general area
though.


        Go to Computer->Properties->Environment (for NT), or
Computer->Properties->Advanced->Environment Variables (for Win 2k). Select
"PATHEXT" in the System Variables section (in NT, or Edit for Win 2k) and then
at the bottom, in the "Value" field, *ADD* ";.PL" (semi-colon, dot, 'P', 'L').
Do NOT clear any of the other extensions that are listed there (like .exe, .com,
..bat, etc.).

        When completed, you'll be able to type in "PerlFile" and have PerlFile.pl run
correctly.  However, it should be noted that if you have both a "PerlFile.pl"
and a "PerlFile.exe" files in your current working directory, and you type
"PerlFile" (i.e., with no extension), then the PerlFile.exe will run and NOT
PerlFile.pl.  In such cases, you'll HAVE to use the extenstion if you want the
Perl program to run.

Hope this helps.

Dean Theophilou

P.S. If you intend to do any serious work with Perl in a Windows environment,
then you should really buy "Win32 Perl Programming: The Standard Extensions", 2
ed., by Dave Roth (www.roth.net).  This is THE book on using Win32 Perl (sorry
O'Reilly, you guys have great books but this one is the very best).

P.P.S. And no, Mr. Roth is not paying me to say that! :)

-----Original Message-----
From: Booher Timothy B 1stLt AFRL/MNAC
[mailto:[EMAIL PROTECTED]]
Sent: Friday, February 01, 2002 2:45 PM
To: [EMAIL PROTECTED]
Subject: make a executable with a perl file in windows


Hello - I just loaded ActiveState perl onto my computer today . . . while I
normally use perl on my unix machine and modify the file using chmod +x
perlFile.pl - what can I do on dos or do I have to type perl PerlFile.pl
everytime to run PerlFile?

Thanks,

Tim


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to