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?

I would highly suggest you do not take an approach like this. Exception based errors (die/eval) are far superior in many respects. If you are not convinced yet, do some research (PBP, Modern Perl). Also look at all the monks! Most have already suggested die() and for good reasons!

Also, in errorstr() I think I see a bug:
$self or return $ERRORSTR; # Class call
I think you meant to do this?
ref $self or return $ERRORSTR; # Class call
But more importantly, use exceptions instead!

Replies are listed 'Best First'.
Re^3: How do I report an error back to the user of my object?
by NetWallah (Canon) on Jun 05, 2012 at 13:47 UTC
    Agreed (and fixed). But I would suggest using Carp which has a "confess" method that can provide a stack trace to point out the callers evil ways.

                 I hope life isn't a big joke, because I don't get it.
                       -SNL