## Should this program daemonize... ## ie: should it run all the time ## in the background? my $daemonize = 1; ################################################## # fork code if ( $daemonize ) { my $pid = fork(); die("fork() failed: $!") unless defined $pid; ## need to do something right here ## to get STDOUT and STDERR to go ## to a file vs the console/screen. if ($pid) { exit(0); } }