Hi,
If my loop continue after 10 seconds, i want it to stop. I tried this :
$n = 0;
eval {
local $SIG{ALRM} = sub { die "Timeout"; };
alarm 10;
while (1) { print "$n\n"; $n += 1; }
alarm 0;
};
if ($@ and $@ =~ /Timeout/) { print "Timeout\n"; }
but it didn't work, the loop is not executed. And if i put the line at
the end of the script :
if ($@) { print "$@\n"; }
it return an error: The Unsupported function alarm function is
unimplemented at ... line 7.
I am using ActivePerl/v5.6.0 under win98. I dont think that alarm is a
module.
So if someone know whats wrong, help me! Thanx in advance.
F�lix Gourdeau -- [EMAIL PROTECTED]
_______________________________________________
ActivePerl mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/activeperl