in reply to Re: perl daemon
in thread perl daemon

Lets assume the following piece of code:
#/usr/bin/perl -w use strict; my $count = 0; while (1) { open(FILE,"filename.txt"); print FILE "$count - \n"; close(FILE); sleep(100); count++; }
If i wanted that piece of code to run at startup, does anything special need to be done with it, to run it from /etc/init.d

If the init script is as follows (cut down for example purposes):
case "$1" in start) daemon /usr/local/bin/myscript.pl ;; stop) #stop stuff here ;; esac

Replies are listed 'Best First'.
Re: Re: Re: perl daemon
by perlplexer (Hermit) on Apr 05, 2003 at 17:42 UTC
    perldoc perlipc has a section on creating daemon processes (for UNIX).
    For Windows, you may not need to do anything special other than adding the script as a service but I'm no Windows expert.

    Hope this helps.

    --perlplexer