<br>
<div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">&gt; This sounds like exactly what I need, but it doesn&#39;t seem to</blockquote>
<div>    &gt; be working.<br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">&gt;  It still freezes at the call to Does it make any difference that I am<br>
</blockquote><div>    &gt; not making a simple system call, but instead a call to a function in a<br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

&gt; module?<br></blockquote><div><br>  perlipc&#39;s POSIX workaround can help if the function has a<br>  networking call with its own timeout which interferes with the<br>  timeout you&#39;ve set.  Here&#39;s a couple of changes to demo the<br>
  fix although perlipc warns this will bypass safe signals:<br><br>    <br></div><div>    use POSIX qw(SIGALRM);   # &lt;---<br><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

&gt; while(1)<br>
<div class="im">&gt; {<br>&gt;   eval {<br>&gt;<br>&gt;   #   local $SIG{ALRM} = sub { die &quot;alarm\n&quot; }; # NB: \n required<br></div></blockquote><div> </div>      POSIX::sigaction(SIGALRM,     # &lt;---<br>                     POSIX::SigAction-&gt;new(sub { die &quot;alarm&quot;; } ) )<br>
           or die &quot;Error setting SIGALRM handler: $!\n&quot;;<br>  <br>  &gt;   alarm 5;<br>  &gt;   # $Scoop_a is my robot object<br><div><br>  &gt;   $ret =<br>  &gt;      
$Scoop_a-&gt;nxt-&gt;get_battery_level(</div><div class="im">  &gt;            $LEGO::NXT::Constants:: NXT_RET);<br>  &gt;    alarm 0;<br>
   &gt;};<br>  &gt; ...  <br></div><div><br><br>Of course,nothing helps if the function does this:<br><br>     local $SIG{ALRM} = &#39;IGNORE&#39;;<br><br>-- <br>Charles DeRykus <br></div></div>