Let's say you want to write an innocent Perl script called main.pl, which when called as main.pl -f FILENAME does the following:
  • makes a system call to encrypt the file
  • ftps the encrypted file to a server
  • waits for the encrypted file to disappear from the server
  • downloads a file called xfer.asc
  • decrypts xfer.asc to xfer.rtp

    Now, for the gotcha: this program is transferring precious military data from the US to Switzerland, and if it fails at any point in the process, millions of dollars will be at stake, not to mention your head will be on a stake.

    The goal then, is not just to execute the program, but to perform each step, announcing the entry into the step, execution of the step, and completion of the step. If completion is successful, we move on to the next step. If it is not successful we send email notification of its failure. and try again. Even if the failure is due to the machine going down, the script must take a look at what it tried and continue its efforts from just where it was when the script went down.


    In reply to Mechanisms for Fault-Tolerant Perl Scripting by princepawn

    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.