I want a script that constantly accepts user input, but runs a
subroutine every second to do other work. My attempt:

$|=1; $SIG{'ALRM'}= "\&alarm_sub"; &alarm_sub;
while (<>) {print "You typed: $_\n";}
sub alarm_sub {print "ALARM!\n"; alarm 1; return;}

fails miserably. What's the right way to do this?

-- 
We're just a Bunch Of Regular Guys, a collective group that's trying
to understand and assimilate technology. We feel that resistance to
new ideas and technology is unwise and ultimately futile.

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to