Here's a bit from the docs. I particularly like cluck.

Carp(3)        User Contributed Perl Documentation        Carp(3)


NAME
       carp    - warn of errors (from perspective of caller)

       cluck   - warn of errors with stack backtrace
                 (not exported by default)

       croak   - die of errors (from perspective of caller)

       confess - die of errors with stack backtrace

SYNOPSIS
           use Carp;
           croak "We're outta here!";

           use Carp qw(cluck);
           cluck "This is how we got here!";


DESCRIPTION
       The Carp routines are useful in your own modules because
       they act like die() or warn(), but report where the error
       was in the code they were called from.  Thus if you have a
       routine Foo() that has a carp() in it, then the carp()
       will report the error as occurring where Foo() was called,
       not where carp() was called.


Jeff Waugh wrote:
> 
> <quote who="Peter">
> 
> > And you would be using ??? instead of croak ??
> 
> IANAPH :) But I do enjoy reading Perl semantics. I can't seem to find
> croak() in the perl docs, other than as an internal function.
> 
> How does it differ from die()?
> 
> - Jeff
> 
>   [ reply 8<'ed ]
> 
> -- [EMAIL PROTECTED] --------------------------------- http://linux.conf.au/ --
> 
>                   ASCII stupid question, get a stupid ANSI.
> 
> --
> SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/
> More Info: http://slug.org.au/lists/listinfo/slug


-- 
SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/
More Info: http://slug.org.au/lists/listinfo/slug

Reply via email to