CARP.PM

# NAME

CGI::Carp - CGI routines for writing to HTTP error log

# SYNOPSIS

use CGI::Carp;

        croak "We're outta here!";
        confess "It was my fault: $!";
        carp "It was your fault!";
        warn "I'm confused";
        die  "I'm dying.\n";

# DESCRIPTION

CGI scripts have a nasty habit of leaving warning messages in the error logs that are neither time stamped nor fully identified. Tracking down the script that caused the error is a pain. This fixes that. Replace the usual

        uses Carp;

with

        uses CGI::Carp

And the standard warn(), die (), croak(), confess() and carp() calls will automagically be replaced with functions that write out nicely time-stamped messages to the HTTP server error log. For example:

       [Fri Nov 17 21:40:43 1995] test.pl: I'm confused at test.pl line 3.
       [Fri Nov 17 21:40:43 1995] test.pl: Got an error message: Permission denied.
       [Fri Nov 17 21:40:43 1995] test.pl: I'm dying.

# AUTHOR

Lincoln D. Stein<lstein@genome.wi.mit.edu>. Feel free to redistribute this under the Perl Artistic License.

# SEE ALSO

Carp, CGI::Base, CGI::BasePlus, CGI::REQUEST, CGI::MiniSvr, CGI::Form