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

I have a command-line utility that takes in a set of arguments, a file of data, does a bunch of crunching, and then creates a set of files of output. I would like to make this funcitonality available via the web. I can certainly put together a little CGI to do this, but was surprised to find after glancing at CPAN that a tool for doing so wasn't already available. It seems the steps are pretty straightforward:
  1. Get and process form input
  2. Fork off long-running process
  3. Return HTML page for either auto-refresh or with URL for pickup
  4. Optional: email user with URL when job complete
Before I go down the road of doing this myself, is there such a module for this general problem? Any other suggestions?

Thanks,
Sean

Replies are listed 'Best First'.
Re: Perl modules for batch web processing
by derby (Abbot) on May 12, 2005 at 19:25 UTC
      Thanks for the pointer to merlyn's writeup. I had seen it before, but had entirely forgotten about it.

      Sean
Re: Perl modules for batch web processing
by Fletch (Bishop) on May 12, 2005 at 19:14 UTC

    Gee, that sounds a lot like an xterm (or iTerm, dtterm, insert your favorite terminal emulator here :).

    Snarkyness aside, that sounds like an interesting project.

Re: Perl modules for batch web processing
by ctilmes (Vicar) on May 12, 2005 at 22:11 UTC
    I would interpose a database with a persistent job queue. The web page captures the form input and inserts new jobs in the queue. A background task monitors the queue and kicks off processing.
Re: Perl modules for batch web processing
by mda2 (Hermit) on May 12, 2005 at 22:24 UTC
    Some years ago I had similar needs...
    Only fork don't solve my problem because the Apache webserver shielded my process, and my process died with apache instance, whithout terminate.

    After more XP I sugest to you eval a code like this:

  • Control session with cookie, ip address or mail
  • Flock to refuse multiple restart on process
  • use fork and "Daemonize" process for dissociation of child/parent.

    --
    Marco Antonio
    Rio-PM