Sure. <br><br><a href="http://www.sdsc.edu/~moreland/courses/IntroPerl/docs/manual/pod/perlfunc/alarm.html">http://www.sdsc.edu/~moreland/courses/IntroPerl/docs/manual/pod/perlfunc/alarm.html</a><br><br> eval {<br> local $SIG{ALRM} = sub { die "alarm\n" }; # NB: \n required<br>
alarm $timeout;<br> $nread = sysread SOCKET, $buffer, $size;<br> alarm 0;<br> };<br> if ($@) {<br> die unless $@ eq "alarm\n"; # propagate unexpected errors<br> # timed out<br>
}<br> else {<br> # didn't<br> }<br><br>Skylos<br><br clear="all">"If only I could get rid of hunger by rubbing my belly" - Diogenes<br>
<br><br><div class="gmail_quote">On Mon, Jan 11, 2010 at 5:27 PM, Christopher Howard <span dir="ltr"><<a href="mailto:choward@indicium.us">choward@indicium.us</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi. I'm still working on integrating LEGO::NXT into my project. Problem<br>
I've hit though is that apparently there are no actual functions for<br>
checking communication status with the robot.<br>
<br>
There is other function I thought I could use to detect (implicitly) if<br>
communication is still established. Problem is that they are /all/<br>
blocking. Documentation basically says that the author hasn't got around<br>
to making non-blocking functions yet, and I don't really have time to<br>
reprogram his module myself.<br>
<br>
So, my perverted, evil question: Is there some hackish way to pull out<br>
of a blocking subroutine? Say, if it has returned after three seconds or<br>
something like that?<br>
<font color="#888888"><br>
--<br>
Christopher Howard<br>
<a href="http://indicium.us" target="_blank">http://indicium.us</a><br>
<a href="http://theologia.indicium.us" target="_blank">http://theologia.indicium.us</a><br>
<a href="http://robots.arsc.edu" target="_blank">http://robots.arsc.edu</a><br>
<br>
</font><br>_____________________________________________________________<br>
Seattle Perl Users Group Mailing List<br>
POST TO: <a href="mailto:spug-list@pm.org">spug-list@pm.org</a><br>
SUBSCRIPTION: <a href="http://mail.pm.org/mailman/listinfo/spug-list" target="_blank">http://mail.pm.org/mailman/listinfo/spug-list</a><br>
MEETINGS: 3rd Tuesdays<br>
WEB PAGE: <a href="http://seattleperl.org/" target="_blank">http://seattleperl.org/</a><br></blockquote></div><br>