I'd write that as...
sub errorstr { # Both class, and Instance Method ref($_[0]) ? $_[0]{ERRORSTR} : $ERRORSTR; }
Yours will die if the user calls ClassName->errorstr.
In reply to Re^2: How do I report an error back to the user of my object?
by tobyink
in thread How do I report an error back to the user of my object?
by SomeNetworkGuy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |