The general solution to this is to use POE, or in particular POE::Component::Client::UserAgent.
That might sound like a formidable thing to want to do, but I've had success in the past doing this without completely re-engineering the program - just turning each turn of the "event loop" you'll have written in your program into its own little POE session.
$h=$ENV{HOME};my@q=split/\n\n/,`cat $h/.quotes`;$s="$h/." ."signature";$t=`cat $s`;print$t,"\n",$q[rand($#q)],"\n";
In reply to Re: Signal Handling and alarm()
by mugwumpjism
in thread Signal Handling and alarm()
by gnork
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |