On Fri, 7 Dec 2001 [EMAIL PROTECTED] wrote:
> Is there a way to use die but not break the entire script?
>
> system ("dir $servervolume > dirinfo") || die "cant get dir info";
>
> I want it that if does die to assign a value of zero to a variable? Is
> that posssible?
Yes, you can use die to throw an exception, using eva. The message die
prints is put into $@.
eval {
system ("dir $servervolume > dirinfo") || die "cant get dir info\n";
};
if($@) {
print "ERROR: $@\n";
#do other things to recover
}
-- Brett
http://www.chapelperilous.net/
------------------------------------------------------------------------
Many people feel that if you won't let them make you happy, they'll make you
suffer.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]