Hello everyone. I've been working on a web application (written in Perl) called perlBB for about 11 weeks ( http://sourceforge.net/projects/perlbb ). I'm getting close to finishing an early version. However, suitable testing methods have become a bit of an "issue" for me on this project. So far I've been testing the code from the command line on my local machine and on a web server that I have an account on. This is OK until I start wishing I could test my application on the local machine "as if" it was running on a server. i.e. a server running on my computer.

I know I could try installing a server on my computer and use that as a test bed, but I have two reservations:

1. The machine in question uses Windows 98.

2. I am thinking that installing a web server and getting the Perl interpreter to work with it could prove rather tricky for a novice like me.

Does anyone know of available test bed systems that fit this bill and aren't too much on the difficult end to set up (on Windows 98)? Any advice appriciated.

Steven.

Recommended Answers

All 9 Replies

Have you not thought about just buying a shared web server. They are very cheap and you could make a website of your own to properly advertise your app. You could then use this to test your site in a hidden directory. Just an idea and it isn't costly and it is very simple to do.

You can run a small webserver like xampp;
http://www.apachefriends.org/en/xampp.html.

It will support an ActivePerl integration in Windows, and their site says it works in Windows 98. You don't need to connect it to the Internet; just run the xampp_start program and then all pages in the xampp/htdocs directory will be available from http://localhost/ as if they were on a server.

It's a really non-envasive package as well.. you can put the xampp folder on a CD/USB disk, and use it anywhere without installing it.

Nice one, that sounds like just the job :p . I'll give it a try. Thanks.

Steven.

if that isn't sufficient, you could run a full distribution of the Apache webserver locally... Apache is a bit meatier, and more configurable. But, I found XAMPP to be useful for small tests.

Well, "installing" it turned out to be easy and I soon had Apache running. I tried the sample Perl script "perltest.cgi" and it worked on the server. However, when I ask the server to run my own script I get

The server encountered an internal error and was unable to complete your request.

Error message: Premature end of script headers: forum.cgi

I can't see what's wrong with it by comparing the top of my script with "perltest.cgi". Did you run into problems like this Matt?

Steven.

well, I found a good "first-thing" to do with test scripts is to change the .pl script first line to:

#!"C:\ActivePerl\bin\perl.exe"

(if that's where your activeperl is)... that stops you needing to extend the tiny Perl version that comes with XAMPP...

Setting that first line is probably the most important thing to do, especially if you use alot of ActivePerl modules.
That message generally means the script threw an error before it sent a content type...
add a use like this:

use CGI::Carp qw(fatalsToBrowser warningsToBrowser);

and then send a "Content-Type" header of text/html before you do anything else....
Without Carp (CGI debug) switched on,; missing modules can be a cause of that kind of error.

commented: Usefull information. Thanks. +1

Yes :p . Local testing is go. Thanks for the advice.

Steven.

Just a quick tip, you shouldn't need to change the #! line in all your modules; just change it in the ones that are directly executed (.pl or .cgi)... the perl interprettor at the first location should figure out that the rest of them are irrelevant...

at least... i think it works that way ^_- Personally, I always put the environment's perl location in a #! in any .pl or .pm file..

EDIT and a quick test proves that that's a waste of a whole line per module :o

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.