Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^5: System and CGI - File Created but not the Content

by moritz (Cardinal)
on Sep 18, 2007 at 12:53 UTC ( #639631=note: print w/ replies, xml ) Need Help??


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.


Comment on Re^5: System and CGI - File Created but not the Content
Download Code
Re^6: System and CGI - File Created but not the Content
by girarde (Friar) 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.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://639631]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (12)
As of 2015-07-07 08:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (88 votes), past polls