Help for this page

Select Code to Download


  1. or download this
    $SIG{ALRM} = sub { exit; };
    
    alarm 60 * 60 * 2;
    
  2. or download this
    open(F, ">$wherever/myscript.pid") or warn "myscript.pid: $!\n";
    print F "$$\n";
    ...
    END {
       unlink "$wherever/myscript.pid";
    }
    
  3. or download this
    [ -r $wherever/myscript.pid ] && kill `cat $wherever/myscript.pid`