Rob,
Show quoted text> I would like to hear some justification for the change. What does
> Carp do for you that the improved die() in 1.0005 does not?
Using croak() gives an error message from the perspective of caller,
that is, gives me the line number in my code and not in your module.
Show quoted text> Also, would an optional usage of Carp if installed be sufficient?
You wouldn't need to make it optional - it's been in the standard
Perl distribution since at least 1999 (version 5.0005):
http://www.cpan.org/modules/by-module/LWP/GBARR/perl5.005_03.announce
Show quoted text> I am loathe to add additional deps if they are not really
> necessary. I'm not saying "No" - I just want to have some solid
> rationale. If it ain't broke and all that.
I'm using your module an made the proposed change to the local copy so I
could figure out where I was doing the wrong thing. Without croak(), it
would have been an uglier patch using caller().
See
http://search.cpan.org/perldoc?Carp for more details. Here's the
description from that page:
The Carp routines are useful in your own modules because they act
like die() or warn(), but with a message which is more likely
to be useful to a user of your module. In the case of cluck,
confess, and longmess that context is a summary of every call in
the call-stack. For a shorter message you can use carp, croak or
shortmess which report the error as being from where your module was
called. There is no guarantee that that is where the error was, but
it is a good educated guess.
--
Mr Mark Suter, Unix System Administrator, Defence Computing Bureau
Contractor to Defence, 02 626 61327 or mark.suter@defence.gov.au
Visit ComLaw via
http://j6.zwit.org/ for the Section 70 used below.
IMPORTANT: This email remains the property of the Australian Defence
Organisation and is subject to the jurisdiction of section 70 of the
Crimes Act 1914. If you have received this email in error, you are
requested to contact the sender and delete the email.