#!/usr/bin/perl
use strict;
use File::Slurp;
use Proc::Fork;
my $code=read_file('./dig.pl');
while(1){
run_fork{
child{
eval($code);
if($@){
ERROR $@;
}
exit;
}
parent{
my $childPid=shift;
waitpid $childPid,0;
}
};
sleep 1800;
use strict;
use File::Slurp;
use Proc::Fork;
my $code=read_file('./dig.pl');
while(1){
run_fork{
child{
eval($code);
if($@){
ERROR $@;
}
exit;
}
parent{
my $childPid=shift;
waitpid $childPid,0;
}
};
sleep 1800;
}
本文转自cloves 51CTO博客,原文链接:http://blog.51cto.com/yeqing/1681656