$SIG{__DIE__} = \&customDie;<br>$SIG{__WARN__} = \&customWarn;<br><br>that should do the trick. and in sub customDie { print $LOG "Im dying: $!\n"; exit 1; }<br>with a similar customWarn... Assuming of course that you have $LOG open for writing :)
<br><br><div><span class="gmail_quote">On 10/4/07, <b class="gmail_sendername">Faber J. Fedor</b> <<a href="mailto:faber@linuxnj.com">faber@linuxnj.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I've got some code like this:<br><br> $sum = $indexTable2->elm($i, "weight");<br> while ($sum <= $captPercentile) {<br> $sum += $indexTable2->elm($i+1, "weight");<br> $bottom_count ++;
<br> $i++;<br> }<br><br>If indexTable2 is empty (it should never be, but hey this is RL), I get<br>errors like:<br><br>Row index out of range [0..-1]Use of uninitialized value in addition (+) at /home/sqa/bin/processMonthlyData.pl line 497.
<br><br>And the program will sit in that loop forever, spitting out this<br>warning/error to STDOUT.<br><br>How do I trap this and DIE with an error message?<br><br><br>--<br><br>Regards,<br><br>Faber Fedor<br>President<br>
Linux New Jersey, Inc.<br>908-320-0357<br>800-706-0701<br><br><a href="http://www.linuxnj.com">http://www.linuxnj.com</a><br><br><br><br><br>--<br>This message has been scanned for viruses and<br>dangerous content by MailScanner, and is
<br>believed to be clean.<br><br>_______________________________________________<br>ABE-pm mailing list<br><a href="mailto:ABE-pm@pm.org">ABE-pm@pm.org</a><br><a href="http://mail.pm.org/mailman/listinfo/abe-pm">http://mail.pm.org/mailman/listinfo/abe-pm
</a><br></blockquote></div><br><br clear="all"><br>-- <br>If you mess with a thing long enough, it'll break.<br> -- Schmidt