Regarding MS-DOS

You can always execute a script by calling the Perl interpreter with the
script as an argument: e.g., perl myscript.pl.  You can also associate files
with the .pl extension with the Perl interpreter, so that executing
myscript.pl will correctly invoke the Perl interpreter and execute your
script.  In NT 4.0 or 2000, the following commands will let you do this:

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

To avoid having to type in the extension (.pl) every time you execute a
script, you can set the PATHEXT environment variable to include Perl
scripts.  This is done in one of two ways:

FOR WINDOWS NT
Computer->Properties->Environment.  In the variable field type in "PATHEXT",
and in the value field type, ADD in ";.PL" IN ADDITION TO WHATEVER OTHER
VARIABLES YOU ALREADY HAVE.  For example, right before I did this on my NT
machine, I had the following variables: ".EXE;.COM;.BAT;.CMD".  So, what I
did was type in "PATHEXT" in the variable field, and in the value field I
typed "%PATHEXT%;.PLX;.EXE;.COM;.BAT;.CMD"

FOR WINDOWS 2K
Go to Computer->Properties->Advanced->Environment Variables. In the System
Variables section (near the bottom), select PATHEXT, click "Edit", enter
";.pl" in the Variable Value field, and then click "Ok".


Regarding "I need help running perl for Windows"

Rac> Whenever I try to open my script from the command line (the
Rac> infamous "Hello, World" script), I can see hello world! on my
Rac> screen for 1 second and then my Perl inturpreter suddenly
Rac> disappears off of my screen;

Another reason you would see it only for a brief moment is because you're
running the Perl script directly; i.e., you double-click the script in
Windows Explorer.  What you should do instead is to open a command prompt
window (Start->Run->Cmd), cd to the proper directory, and then start the
script.

If you want to start a Perl script from, let's say, a batch file, you have
the option to call Cmd.exe (see note below) with the "/C" or "/K" options:

/C      Carries out the command specified by string and then terminates
/K      Carries out the command specified by string but remains

NOTE: you should always (IMHO) use "cmd" rather then "command".  These are
two DIFFERENT programs, although they look identical.  Cmd.exe doesn't
require the use of quotes with long file names, and has other benfits that
I'm too tired to remember right now. :)


Dean Theophilou
Genisar


P.S. I hope this response seemed coherant (I'm REALLY tired right now), but
if it didn't, I apologize.




-----Original Message-----
From: Tim Musson [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 15, 2001 1:10 PM
To: Mark Folse
Cc: Crystal Gruetzmacher; Perl_beginner (E-mail)
Subject: Re[2]: MS-DOS


Hey Mark,

Friday, June 15, 2001, 2:48:14 PM, you wrote:

MF> Is Perl in your system path? The first line in the script doesn't help
MF> any in DOSneyland. I usually just type "perl script.pl" if it is. It is
MF> possible to associated the dot-p-l extension with Perl.exe in the
MF> Windows GUI, but I don't believe its possible to flag an executable in
MF> dos that isn't EXE or COM (or BAT or CMD). Usually if you need to run
MF> in the dark box, you make a batch file.

I run Win2k, and have my .pl files set up so that they are executable.
If anyone wants to know, I can figure out how I did it, but I also
think it is on the ActiveState web site (I am far from being a M$
person, I just run what my current client wants... :-).

--
[EMAIL PROTECTED]
Using The Bat! eMail v1.53
Windows NT 5.0.2195 (Service Pack 1)
Women and cats will do as they please, and men and dogs should relax and get
used to the idea.


NetZero Platinum
No Banner Ads and Unlimited Access
Sign Up Today - Only $9.95 per month!
http://www.netzero.net

Reply via email to