Debug question

J

JoeyP

I am accessing a (perl)CGI script from an HTML doc. Something is
blowing up in the CGI.
How do I send an 'alert' pop-up message while in the CGI?

I tried print " alert("Error"); "; but that didn't work.

I am new to perl.

Thanks for your help.
 
P

Paul Lalli

JoeyP said:
I am accessing a (perl)CGI script from an HTML doc. Something is
blowing up in the CGI.
How do I send an 'alert' pop-up message while in the CGI?

You don't. If something is "blowing up" in the CGI program, that
program is not going to correctly create an HTML document that the
browser can render. It is the browser's own Javascript that would
process the alert box.
I tried print " alert("Error"); "; but that didn't work.

Not surprising...
I am new to perl.

The problem has nothing to do with Perl and everything to do with CGI.
You seem to have a fundamental lack of understanding about what a CGI
program is.

If your Perl program is malfunctioning, you need to look at the error
output and see why it's malfunctioning. Either look in the CGI
server's error log, or put this statement near the top of your program,
right after 'use CGI;'
use CGI::Carp qw/fatalsToBrowser/;

Paul Lalli
 
J

JoeyP

Paul said:
You don't. If something is "blowing up" in the CGI program, that
program is not going to correctly create an HTML document that the
browser can render. It is the browser's own Javascript that would
process the alert box.


Not surprising...


The problem has nothing to do with Perl and everything to do with CGI.
You seem to have a fundamental lack of understanding about what a CGI
program is.

If your Perl program is malfunctioning, you need to look at the error
output and see why it's malfunctioning. Either look in the CGI
server's error log, or put this statement near the top of your program,
right after 'use CGI;'
use CGI::Carp qw/fatalsToBrowser/;

Paul Lalli

Thanks a bunch Paul.

use CGI::Carp qw/fatalsToBrowser/; worked.

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top