#!/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 $child_pid=shift;
waitpid $child_pid,0;
};
sleep 10;
}
本文轉自cloves 51CTO部落格,原文連結:http://blog.51cto.com/yeqing/1679711