Book HomeJava and XSLTSearch this book

8.35. CGI::Carp

Creates Carp-like CGI routines for writing error messages to the HTTPD or other error log. Exports functions for warn, die, carp, confess, and croak. The functions write timestamped error messages to your server log or other output that you specify. See Section 8.32, "Carp" for details on the Carp functions.

Two other functions are provided by this module. Neither are automatically exported, so you must explicitly import them in use:

use CGI::Carp qw(carpout fatalsToBrowser);
carpout

carpout \*fh

Sends error messages to the filehandle fh. You should provide a reference to the filehandle glob, although you can also just use the filehandle's name for this function.

fatalsToBrowser

fatalsToBrowser

When this routine is imported via use, fatal errors, such as those produced by die and confess, send error messages to the browser as well as the error log. A simple HTTP response is created with the error message, followed by a request to send mail to the web administrator.



Library Navigation Links

Copyright © 2002 O'Reilly & Associates. All rights reserved.