Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I am using CGI::Carp to get debugging info from a cgi script and it works great, but some os the messages I want to continue to log when the script is in production. How do I get rid of the ...at <scriptname> line ##. Right now the log file gets lines like:
date scriptname: what I told it to print at /path/to/script line ##
All I want is: date scriptname: what I told it to print Thanks in advance. Tom

Replies are listed 'Best First'.
Re: CGI::Carp Question
by gellyfish (Monsignor) on Mar 05, 2002 at 21:19 UTC

    CGI::Carp has a set_message() method - you can use this to modify what is output.

    /J\

Re: CGI::Carp Question
by cmilfo (Hermit) on May 26, 2002 at 01:29 UTC
    Add a line feed to your die() statement. For instance,

    die "This is a bad error: $!\n";

    That should get rid of the "at line ##".

    Cheers!