Testing Perl scripts locally

  ok, I got the interpreter, I got the HTML editor and I got the desire.

   What I don't have is the knowledge of how to invoke the scripts locally.

  The interpreter is in the f:/Perl/Perl directory, what I need is how to send the scripts to it.  
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

1.14. When I double-click on the "perl.exe" icon in Explorer, I get an empty DOS
window with a blinking cursor. What gives?

Perl for Win32 is a Win32 command-line program. It expects to be run from the command line, not from

If you want to run a Perl script, write the script out using a text editor like Notepad. A good starter program

    print "Hello, World!\n";

Save the program to a file on your hard disk (such as "C:\temp\hello.pl"). Now, start a command prompt
window (sometimes erroneously called a "DOS window"), and type the following line at the command

    C:\> perl c:\temp\hello.pl

This should print out the words "Hello, World!" on the screen. You may have to do some fiddling with the
PATH environment variable, or specify the full path name to perl.exe, in order for this to work.

perl.exe has a lot of nifty command-line arguments that can make your work a lot easier. See the perlrun
documentation page for details.

To answer the original question about what's happening when you start perl from an Explorer window
rather than a command-line window: starting from Explorer is roughly the same as starting perl without any
command line arguments. When perl is started without a script file specified on the command line, it
expects to receive a Perl program as standard input, i.e., from the keyboard.

The blinking cursor means perl is waiting for your input. You can actually type in a Perl program from the
keyboard, and then let perl know to execute it by typing the Ctrl-Z key, which is the end-of-file marker on
Windows systems.

mwhittAuthor Commented:
umm...possible cross question comment?

  ok, let me re-phrase.

  For example, let's say I write a guestbook script and create a form on a locally stored web page.

  What I need to know is how to test the said guestbook (I haven't actually written the script yet) without uploading it to the web server.

  I am not actually looking for the code for a guestbook, just a way to test Perl enhanced web pages locally (without uplosing them to my ISP provider).

  I hope this clears up the question.
You can run them like any other perl program, and see if the output
looks like the right html code.
If you used some of the nicer cgi modules to build it, you may be
able to pass query strings to it on the command line, or in stdin,
otherwise, you can set environment variables.
You can also run it through a local server on your own machine.
Amazon Web Services

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

mwhittAuthor Commented:

  ok, a little Perl backround on me...there is none.

  I am just starting on Perl and need to find out, in layman's terms, how to test the scripts locally. I have web pages out tere and know quite a bit about HTML and such, but what I need is to test scripts locally because putting them on my ISP is a real hassle and I don't want to have to upload them more than once and have them work the first time I upload them.

  Also, I realize that I can run a server locally, however unless  one comes with Win 95 I don't have one.
mwhittAuthor Commented:
btw, I tried your example from the first comment and I got something called a stub error (whatever that is).
So, the first step seems to be, how can you run _any_ perl program.
(Did any documentation come with it?  Perl normally comes with tons of
free documetation and FAQs.  I'm not sure about Win95 specific issues)
First of all, can you run the interpreter at all?
Can you type
from the command line, and start typing perl code at it?
mwhittAuthor Commented:
When I try to I get

Stub Error:
unknown directory

and no, I did not get any documentation...go figure.
The lack of documentation may prove to be a problem, as it sounds
as if your interpreter may not have been installed properly.
(like it's missing some library function in dos4gw, or it hasn't
been told where the directory is supposed to be)
I don't suppose
perl -v
perl -V
tell you anything?
try following batch script, it must be called with the extension (.bat) otherwise there must be a more tricky solution at the  perl.exe  call (see %me% variable).

[------------------- snip here --------------------]
@REM = '
SET me=%0
SET args=
IF "%1"=="" GOTO _endargs
SET args=%args% %1
GOTO _args
F:\perl\perl\perl.exe -S %me% %args%
GOTO _exit
@REM ';

print "write your perl script here, down to the __END__ directive.\n";


SET me=
SET args=

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
mwhittAuthor Commented:
ok, I finally figured it out.

 The interpreter I had was corrupted or something.  I go a new one and it works just fine.

thanks all

I am going ahead and giving ahoffmann the points for two reasons:

1. That was alot of typing.
2. The example probably works.

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.