Good evening

I have a large number of files that contain meta data formatted as xml. The files are placed in a well organized directory tree, categorized by time and place of creation. I am parsing the XML using HTML::Parser and entering the data that I am interested in into a relational database, by walking the nodes of the tree using File::Find

All is working very well... but there is an issue that has to do with the shear volume of the data that I am processing, tens of thousands of files.
I am thinking of methods that I can use to gracefully interrupt the process, without loss of data, and then pick up where I left off at a later time, and perhaps on a different computer.

My idea, that should work, is to periodically check for the existence of a file (could be stdin) that would have a command instructing the program to finish what it's doing, record where it is, the next file to be processed, and then gracefully exit. Use of a command would allow for future direction from the outside, but thats beyond the scope of my question.

my question, simply put is there a better way, perhaps something in CPAN, signals or whatever. I'm thinking that if I write this, I might very well be reinventing the wheel. And would be happy to use OPC.

Largins


In reply to Gracefully exiting and restarting at a later time. by Largins

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.