On 4/26/05, Wagner, David --- Senior Programmer Analyst --- WGO <[EMAIL PROTECTED]> wrote: > Craig Moynes wrote: > > Hi All, > > I am using the spreadsheet::parseexcel module to open up a series (31) > > spreadsheets and grab the row counts. > > > > Here is an excerpt with the ParseExcel Code. > > > > my $oBook; > > my $oWks; > > foreach $hashEntry ( @LOGS ) > > { > > > > my ( $localfile) = $hashEntry->{name}; > > my ( $err_msg ) = ""; # error message > > variable > > > > > > my $cmd = ""; > > > > # > > # Get row count of each file, to generate results file > > # > > $oBook = new > > Spreadsheet::ParseExcel::Workbook->Parse($localfile); my > > ($iR, $iC, $oWkS, $oWkC); $oWkS = ${$oBook->{Worksheet}}[0]; > > > > print "------ SHEET: ".$oWkS->{Name}. "\n"; > > print "Row: ".$oWkS->{MinRow}." v ".$oWkS->{MaxRow}."\n"; > > > > $resultMessage.=basename($localfile).",".$oWkS->{MaxRow}."\n"; } > No where do I see you closing or destroying the existing data > structure. I was >working on similiar item and only wanted the first row and > last column, but it was loading >the whole file in. Forunately one of the > Perl gurus provided a work around, but to get the >last row of each Excel > file will require the loading of the whole file, unless some guru has a >work > around that cheats loading the whole file.
I thought that by defining the oBook and oWks variables outside the for loop, that the memory for an old object referenced in those variables would be garbage collected when reassigned. Can you paste a code sample for the garbage collection stuff that the gurus supplied you with. Cheers, Craig -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>