package Carp;
use Carp;
no warnings;

sub croak   { carp_err(  shortmess( "<B>", @_, "</B>" ) ); }
sub confess { carp_err(  longmess(  "<B>", @_, "</B>" ) ); }
sub carp    { carp_warn( shortmess( "<B>", @_, "</B>" ) ); }
sub cluck   { carp_warn( longmess(  "<B>", @_, "</B>" ) ); }

sub carp_warn
{
    my @c = caller(2);
    $_ = shift;
    $c[3] = $c[3] ? $c[3] . ": " : '';

    s/\n/<br>/g;
    print "<span style=\"color: navy\">$c[3]$_</span>\n";
}

sub carp_err
{
    my @c = caller(2);
    $c[3] = $c[3] ? $c[3] . ": " : '';
    $_ = shift;

    print STDERR "$c[3]$_";

    s/\n/<br>/g;
    print "<span style=\"color: maroon\">$c[3]$_</span>\n";
    exit;
}

1;
