in reply to cron with perl

Are you on *nix or Windows? It's not impossible, but on *nix it will be tricky to have cron start the daemon while connected to a real terminal, as cron just doesn't work the way you'd like. You probably would have to write a wrapper script for starting it under cron and connecting your daemon's I/O to the user's console.

For writing a wrapper, take a look at Net::Server. It handles all the low-level I/O for you, allowing you to write just the high level code.

It has several different ways of operating, so one may be right for your application. It takes care of things like PID files and backgrounding the process.

I recently implemented a simple server using Net::Server and found it had some useful examples. In my case examples/samplechat.pl was handy to examine.

Replies are listed 'Best First'.
Re^2: cron with perl
by Pstack (Scribe) on Nov 09, 2010 at 20:57 UTC

    Eventually both *nix and Windows, but just *nix at present, deploying a KDE-Konsole (for the user-useful extra things like 'Save History' etc).

    And this seems to be definitely on the right track ..."as cron just doesn't work the way you'd like".

    I will come back when Net::Server docs swallowed.

    Huge thanks for the pointer.

      UPDATE

      Found a temporary OS-local solution under KDE using 'dcop' tool via shellscript wrapper call in a display-tweaked cron environment.

      Still to play with Net::Server, but more hopreful of a cross-platform solution in that direction.

      The discussion proved very useful. Thanks all.