Enlightened Ones,

please lend me your wisdom!

I am extracting a lot of information from the web. During a trial run my internet connection scrambled for a while, leading to the error message "use of uninitalized value..." when the programme tried the process the data that it failed to download during this time. As I was sitting next to the screen I could monitor this, but the download will last for close to a day and naturally I do not want to be glued to the screen for quite so long (plus, I print out the current operation on the screen, so I cannot just come back to see if there was anything). To make it even more complicated, I also want to record where the problem occured. The files I am downloading are related to an internal number. Thus, I want to record the error message alongside this number. And finally, it would be nice to be able to see that the programme is running at the same time - which would exclude redirecting all output (i.e., also a print command with the current file) from the screen to a file. Oh, did I mention that I am using Windows (I know, I know, ...).

Long story, short conclusion: I want to continue the programme (so no die in connection with the get for this particular problem), but create a logfile listing all error messages (not just the ones related to a failure of a get-command or the opening of files, etc.). Besides the error messages it should also include the number of the file where the error occured. This should not interfere with other reading/writing operations, in particular not with printing standard output to the screen. The general idea is to keep the programme running, monitoring its progress and fix errors with some files later.

Is there a way to write all (non-fatal) error messages occuring during the execution of a programme into a file? Would this interfere with any reading/writing operation on other file (for a construction opening a logfile in the beginning and closing at the very end)?

Thanks in advance!


In reply to Logfile for Error Messages by New Novice

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.