Your IP : 216.73.217.90


Current Path : /proc/self/root/proc/thread-self/root/usr/share/doc/perl-IPC-Run/eg/
Upload File :
Current File : //proc/self/root/proc/thread-self/root/usr/share/doc/perl-IPC-Run/eg/run_daemon

/usr/bin/perl -w

## An example of how to daemonize.  See the IPC::Run LIMITATIONS section for
## some reasons why this can be a bit dangerous.

use strict;

use IPC::Run qw( run close_terminal );

run(
    sub {
        # ... your code here ...
        sleep 15;
    },
    init => sub {
        close_terminal;
        exit if fork;
    }
);