Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
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 lurking in the Monastery: (13)
As of 2014-10-21 13:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (103 votes), past polls