alarm(5); : alarm « System Functions « Perl






alarm(5);

    


print "Type something...\n";

local $SIG{ALRM} = sub { print "Sorry, timed out.\n"; exit; };
alarm(5);

while(<>) {
    print "Thanks, please type again...\n";
    alarm(5);
}

   
    
    
    
  








Related examples in the same category