CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Frequently Asked Questions:
How can I display an error in a CGI program?

 



japhy
Enthusiast

Dec 15, 2000, 8:21 AM

Post #1 of 1 (5645 views)
How can I display an error in a CGI program? Can't Post

If your CGI program die()s, and you would rather have a message sent to the browser about it, use the CGI::Carp module:


Code
use CGI::Carp 'fatalsToBrowser'; 

$x = 10;
$y = 0;
$z = $x / $y;

This will send the "division by 0" message to both the browser AND your error logs. Remember to check the error logs every time an error occurs in a CGI program. If you do not know where they are, do not ask us (we could not possibly know) but instead ask the administrator of your web site.

Jeff "japhy" Pinyan -- accomplished hacker, teacher, lecturer, and author

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives