I work for a operational ocean observatory and we have been deploying autonomous underwater vehicles (AUV) which patrol the world's oceans and periodically call in to a central server in our lab over a satellite communication link to transfer data files. I've been running a variety of scripts on my crontab at roughly 5 minute intervals to process this data and display it on the web; however, the AUV calls in about once every 6 hours, so the cronjob spacing is a bit of overkill, but required to minimize the time between file transfer and processing.

Each time the AUV calls in, a new log file is created and written to, so what I'd like to do is set up a kind of event handler that will watch the log directory and trigger a set of callbacks to perform a variety of tasks.

While I have not used them, I'm aware of the following to handle asynchronous events:

Event.pm
Event::Lib
POE

As a relative newbie to Perl, what I'd like are some suggestions that allow me to accomplish the following:

1. Get something up and running quickly.
2. The flexibility to expand once I become familiar with the module.

All suggestions appreciated.

UPDATE: Sorry, I was a bit unclear here and left something out:
1. We do have a number of AUVs that could be simultaneously deployed.
2. The AUV can be programmed to surface and call in at a number of preset intervals. Currently, we are using 6hrs as the interval, but this definetely can vary. For example, if the satellite link is down, the AUV is also programmed to call in when it gets a good link.

I should rephrase and say that I'm not sure when the AUVs will call in, which is what I mean by asynchronous.
The processing does NOT take more than 6hours, but, in the future, I'd like to have the ability to retask the AUV depending on the data that comes in. Since the satellite comm link can only occur when the glider is on the surface, the retasking needs to occur immediately when the AUV connects.

Also, the AUVs are deployed for upto 2 months at a time, so the application needs to run for the duration without interfering with other processes.
Sorry for the confusion.


In reply to Handling asynchronous events with Perl by njcodewarrior

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.