$SIG{__DIE__}&nbsp; = \&amp;customDie;<br>$SIG{__WARN__} = \&amp;customWarn;<br><br>that should do the trick. and in sub customDie { print $LOG &quot;Im dying: $!\n&quot;; 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> &lt;<a href="mailto:faber@linuxnj.com">faber@linuxnj.com</a>&gt; 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&#39;ve got some code like this:<br><br>&nbsp;&nbsp;$sum = $indexTable2-&gt;elm($i, &quot;weight&quot;);<br>&nbsp;&nbsp;while ($sum &lt;= $captPercentile) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $sum += $indexTable2-&gt;elm($i+1, &quot;weight&quot;);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$bottom_count ++;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$i++;<br>&nbsp;&nbsp;}<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&#39;ll break.<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-- Schmidt