Hi,
Could any one tell me what is wrong with my code? It does not time out after 5 seconds which is what i need. It remains in the infinit loop.
#! /usr/bin/perl
use strict;
use warnings;
sub comeOut;
$SIG{ALRM} = \&comeOut;
while (1) { };
eval
{
alarm 5; #timeout is 60
}
sub comeOut
{
print "\nGot the signal...Exiting...\n";
exit;
}
Pls help me...