Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks,

I have perl script, that have to run 24x7 in background on windows.

Please tell me how to run a perl script in background process on Windows.

  • Comment on How to run perl script in background on Windows

Replies are listed 'Best First'.
Re: How to run perl script in background on Windows
by BrowserUk (Patriarch) on Jan 25, 2011 at 17:19 UTC

    If the process is going to run 24/7, you probably don't want someone to have to log-in to start it, or remain logged in whilst it runs.

    In windows, this is typically done by making the process a 'service'. See Win32::Service and Win32::Daemon.


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.
Re: How to run perl script in background on Windows
by wfsp (Abbot) on Jan 25, 2011 at 17:10 UTC
Re: How to run perl script in background on Windows
by Anonymous Monk on Jan 25, 2011 at 18:04 UTC
Re: How to run perl script in background on Windows
by GrandFather (Saint) on Jan 26, 2011 at 07:17 UTC

    Actually, in the simplest case all you need to do is run the script! If you need it to start when the system boots add a short cut to it to the Startup entry in the Start|All Programs menu. If you need to hide the console window and you are using Active State's Perl you can use wperl.exe rather than perl.exe to achieve that.

    True laziness is hard work