Thanks. Here's one spot where premature exit is happening. The script reads 6.6 million lines from one file then comes over to read this file which it will compare to the 6.6 million lines it has already processed. Gets to line 300 of the second file and just stops. No error is thrown by Perl or by the error handling I put in the script. Just stops. Unusual record formats are highly likely too as this data is coming from someone else's system. We are running this on a huge box too so the system never says it has run out of memory. Seems to have 1.5 gigs of memory when it stops. The memory does seem to take a big drop just before it exits. Here is the read snippet where I beleive the exit is occuring.
This snippet is reading the file and comparing the keys from the items it's reading to the keys from the items from a previous file it read in. Never had a script just die on my like this?
while (<IM>) {
chomp;
print "$.\n";
my @fields = split /\t/; #splits the line into values
if ($. == 1) { #find header row
@prodkeys = @fields; #assign header info to the hash keys
next;
}
unless (/[\t]*$/) { #skip any blank lines
++$imtotal;
my %prodhash = (); #this stuff defines the array of hashes
$dtlkey = 0;
@prodhash{@prodkeys} = @fields;
$prodhash{'VENCODE'} =~ s/^[ ]*|[ ]*$//g; #clean any leading or trailing spaces from the keys
$prodhash{'VENCATNUM'} =~ s/^[ ]*|[ ]*$//g;
$prodhash{'FACID'} =~ s/^[ ]*|[ ]*$//g;
$itemkey = $prodhash{'VENCODE'} . $prodhash{'VENCATNUM'};
if ($prodhash{'UOM'}) {
$prodhash{'UOM'} =~ s/^[ ]*|[ ]*$//g;
$dtlkey = $prodhash{'VENCODE'} . $prodhash{'VENCATNUM'} . $prodhash{'UOM'} . $prodhash{'FACID'};
}
if ($unqitems{$itemkey}) {
$unqitems{$itemkey}{'INIM'} = "Y"; #flag unique PO history items that are in the IM
} else {
push @imnotpo, \%prodhash; #store all im items that are not found in the PO history
}
if ($dtlitems{$dtlkey}) { #check in IM for the item for detail report
$dtlitems{$dtlkey}{'INIM'} = 'Y'; #flag unique PO history items that are in the IM
} else {
push @imnotpodtl, \%prodhash; #store all im items that are not found in the PO history
}
}
}
Cheers,
Sloppyhack