in reply to Re^4: System and CGI - File Created but not the Content
in thread System and CGI - File Created but not the Content

Here is an example how you write a perl script that moves itself into the background (might not work on windows...):

!/usr/bin/perl use strict; use warnings; my $ret_val = fork(); if (! defined $ret_val){ die "Can't fork(): $!"; } elsif ($ret_val == 0){ # do your daemon tasks here sleep 5; print "Exiting\n"; } else { exit 0; }

As for the server you should check the Net::Server module.

Replies are listed 'Best First'.
Re^6: System and CGI - File Created but not the Content
by girarde (Hermit) on Sep 18, 2007 at 13:30 UTC
    Here is an example how you write a perl script that moves itself into the background (might not work on windows...):

    That's OK. The original script almost certainly would.