|
because combining php and perl could lead you into complicated problem (as I did)
ones giving me simple solver, just use time out (alarm) feature
local $SIG{ALRM} = sub { die("TIMED OUT") };
eval {
alarm(20); #set our alarm for 20 seconds
$wBook = $fExcel->Parse($filename); #parse xls file
alarm(0);
};
if ( $@ =~ /TIMED OUT/ ) {
print "file $filename load error! time out on processing, could be corrupt!\n";
goto ended;
};
not_ended_runs_here: ....
it solved my problem!
it uses same concept as php module which I try before, that php module also use timeout feature too
|