[an error occurred while processing this directive]

Как ограничить время выполнения Perl блока таймаутом
use constant TIMEOUT => 1;
eval {
   local $SIG{ALRM} = sub { die "timeout during sysread\n"; };
   alarm(TIMEOUT);
   $read_flag = sysread($filehandle, $c, 1);
   alarm(0);
};
 
14.08.2002
Ключи: time, perl, file, timeout / Лицензия: CC-BY
Раздел:    Корень / Программисту и web-разработчику / Perl / Функции и модули в Perl

[an error occurred while processing this directive]

[an error occurred while processing this directive]