Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Any Suggestions??? Appearently a bad script!
Message
 
À
22/07/2002 11:20:29
Information générale
Forum:
Perl
Catégorie:
CGI/HTTP - Applications Internet
Divers
Thread ID:
00681164
Message ID:
00681570
Vues:
13
Hi Richard,

When running a multi-tier web application, there are several areas that must be examined when debugging the app. I am assuming your are using html for the presentation or GUI layer. As you indicated, you are using perl script to provide the logic to perform calculation, etc, and you are using perl.exe to execute the script. At this point it appears you are not using any back-end database server.

I don't know whether you are running apache on either windows or linux, or maybe your running IIS on windows. In any even are you sure you have the web server configured and working with perl. You could run a simple test to see by have a web page call a perl script that returned "Hello World". The script, let us call it "test.pl", could be something like this:
#!/usr/bin/perl -w

print "Content-type: text/html\n\n";

print "Hello World";
Your html page could call this script like:
<!--#exec cgi="/cgi-bin/test.pl"-->
If your web server is configured correctly, "Hello World" should appear in your html page where you called it with the "#exec" command.

You could also run the script from perl to make sure it runs without any error. For example you could do the following:

perl test.pl

Now, back to your question.

The particular error you are getting would indicate you have a problem with the web server not finding the perl script. Make sure your relative paths are working. Sometimes this envolves configuring the web server correctly.

Also, if your running your script on hardware and software provided by an ISP, it is likely your running the apache web server under linux. About 90% of all problems when using an ISP running apache on linux is permissions. Be sure to assign the minimum permissions necessary to run the script but no more.

In short, it is likely that you have more that one problem, and you must test each area to make sure its working. Eventually the script will begin to work.

One other hint. If your version of perl is current enough, and your web server allows, the following will direct error messages to the screen as opposed to a log file: I have found that sometimes it works, and sometimes it doesn't, so it depends on a lot of things like which version of perl you are running, how the web server is configured, etc. If it works you will see descriptive error trap messages on your screen complete with the perl script line number that generated the error message.
#!/usr/bin/perl -w

print "Content-type: text/html\n\n";

use CGI qw( :all );
use CGI::Carp qw( fatalsToBrowser );
You might check your perl doc to see if this command is available. If not, and you have access to the web server log files, you could check them to see if it provides a more descriptive message about errors.

Also, you might look for a book on perl with emphasis on cgi-bin programming. Hopefully it would give example that match the web server and operating system you are using.

I tried to run you script from my linux box's command line, and the script failed at line 8. It appears you are trying to assign variables to an array, but the line ends in =;. You may have several problems with the script itself.


Good Luck
Leland F. Jackson, CPA
Software - Master (TM)
smvfp@mail.smvfp.com
Software Master TM
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform