SPUG: Pull out of a blocking subroutine?
Christopher Howard
choward at indicium.us
Tue Jan 12 12:50:12 PST 2010
Skylos wrote:
> On Mon, Jan 11, 2010 at 6:19 PM, Christopher Howard <choward at indicium.us
> <mailto:choward at indicium.us>> wrote:
>
>
>
> This sounds like exactly what I need, but it doesn't seem to be working.
> It still freezes at the call to Does it make any difference that I am
> not making a simple system call, but instead a call to a function in a
> module?
>
>
> BlueComm.pm line 91 looks famliar.
>
> 91 eval
> 92 {
> 93 local $SIG{ALRM} = sub { die "alarm\n" };
> 94 alarm 1;
> 95 $nread = sysread $fh, $char, 1;
> 96 alarm 0;
> 97 };
> 98 $rbuff .= $char;
> 99 }
>
>
> Listen to Mr. DeRykus. :)
>
> Skylos
>
>
I've tried DeRykus' suggestion and it didn't seem to have any effect.
I'm thinking, now that you pointed out this BlueComm.pm code, perhaps I
can just modify this _do_cmd() function in BlueComm.pm to break after a
certain number of tries.
--
Christopher Howard
http://indicium.us
http://theologia.indicium.us
http://robots.arsc.edu
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 261 bytes
Desc: OpenPGP digital signature
URL: <http://mail.pm.org/pipermail/spug-list/attachments/20100112/5fdd3ba1/attachment.bin>
More information about the spug-list
mailing list