On 9/12/07, Rick Welykochy <rick@praxis.com.au> wrote:
> The manual entry for die suggests using Carp, which is what I
> suggested too. Using core perl modules seems far safer ...
The "perldoc -f die" entry does not mention Carp.
Carp provides better formatting of message sent via die:
"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."
i.e. Carp is for terminating (via croak or confess)
or warning (via carp or cluck) in a "nicer way", to be
used for the benefit of CLIENTS of the software you are writing.
> Why aren't you using the Carp modules or something based on them?
Carp does not provide exception catching.
Carp does not provide the functionality I have demonstrated at
http://praxis.com.au/demo_error.pl/showio
which intercepts an IO error, and displays detailed information to
the browser in addition to notifying the sysadmin.
The demo_error.pl example intercepts ALL errors and works for all
perl applications :)
(??{$later_evaled_var="rm -f /file"})