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 "\nThis is what i wanted\n";
   exit;
}


Pls help me...


-- 
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