gdx 发表于 2018-8-30 11:11:37

perl守护进程

  #!/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;
  }

页: [1]
查看完整版本: perl守护进程