PDA

View Full Version : how do i test my own perl script?


animalssj
12-06-2002, 09:12 PM
How after I code a perl script do I test it??
How can I install perl on my local system?
If the perl files are on my desktop and I'm running the file from the same folder, is it

#!./perl

i'm a perl newbie learning the ropes.
thanks

Philip M
12-09-2002, 07:40 PM
Perl is really intended for Unix systems, but there are versions which can be downloaded and run under DOS (not Windows).

The command line (when in the correct directory) is

#!perl

and you can add command line options -c or -w

-c causes perl to check the syntax of a program without running it.

-w causes perl to check for common programming errors.

eloi_egon
12-09-2002, 08:03 PM
I've you're running on a Win-system you can and have to install

Serversoftware, for example: Apache Httpd-server (http://httpd.apache.org/)
ActiverPerl (http://www.activeperl.com)


Best you can do (if running on a win-system and dont want to spend time installing and configuring apache and perl) is to get Phperl2 (download:http://prdownloads.sourceforge.net/phperl2/Phperlv2.0.exe?download) and install it on your c-drive. A

After instal change the she-bang-line in your script to the perl.exe(something like !c:/phperl2/perl/(check where perl.exe is installed)), copy your perlscript to c:\phper2\websites\cgi, start phperl and go to your browser and enter: Localhost/cgi/yourscript.pl

Enjoy