Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^2: How do I report an error back to the user of my object?

by kcott (Archbishop)
on Jun 05, 2012 at 19:01 UTC ( [id://974526]=note: print w/replies, xml ) Need Help??


in reply to Re: How do I report an error back to the user of my object?
in thread How do I report an error back to the user of my object?

use Carp qw/confess/;

I might just point out that this code stops the importation of carp and croak.

By default, Carp imports confess, carp and croak. So, unless you specifically wanted to exclude carp and croak, you can just write:

use Carp;

If you wanted to export a non-default symbol (e.g. cluck) but still include the defaults, you can write:

use Carp qw{:DEFAULT cluck};

See Exporter for a description of :DEFAULT and other Specialised Import Lists.

-- Ken

Replies are listed 'Best First'.
Re^3: How do I report an error back to the user of my object?
by tobyink (Canon) on Jun 05, 2012 at 19:24 UTC

    I might just point out that this code stops the importation of carp and croak.

    Indeed, but I was using neither of those so saw no need to import them.

    perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://974526]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (3)
As of 2024-04-25 17:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found