I am not sure if the for loop you have is doing exactly
what it should. I don't know for sure since I can't run it to
duplicate what you are doing. I did look on the Perl Monk
site and found
this.
Have you tried it with that module?
I will be honest and say that I am slightly confused by the
opening of a new file during the processing or at least that
is what it looks like to me. That may effect the loop as well.
if (-e $NEXT_FILE){
sleep 3; #SLEEP TO ALLOW OS TO SYNC UP
close(ACCT);
$DETAIL_FILE = $NEXT_FILE;
open (ACCT, "$DETAIL_FILE") || die "couldn't open f
+ile: $!\n";
$NEXT_FILE = get_next_file_name($DETAIL_FILE);
next;
#NEXT FILE DOESN'T EXISTS, SO SLEEP AND TRY AGAIN
}
That is the block that worries/confuses me. I notice on the
first file you open prior to the for loop you remove the
first line that may be invalid. I don't see any code
verifying the other lines coming into the script. That is
no test for the correct number of array elements. Could
there be bad lines in the data feed that aren't
accounted for?
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.