Did not misconstru anything, I searched through all 966 posts but found no help except did confirm that "parses the entire spreadsheet document into memory."

No where in the 966 posts was it said that rows and columns are in sequence when passed through the cell_handler

I experimented and confirmed, perl does not release memory to a free pool on undef of the Spreadsheet::ParseExcel object reference. So, the memory used during the parse process is sitting there unused and un-allocatable to other variables.

my $cell_outputfh; for (my $i=0;$i < scalar(@workbook_zip_FNS) ;$i++ ) { my $xls_parser = Spreadsheet::ParseExcel->new( CellHandler => \&HH_cell_handler, NotSetCell => 1 ); open ( $cell_outputfh, ">:encoding(iso-8859-1)", $ribbon_srcgeo[$i +].".csv" ) or die " open failed on $ribbon_srcgeo[$i].csv $!"; my $workbook = $xls_parser->parse($unzipped_xls_FNS[$i]); if ( !defined $workbook ) { die $xls_parser->error(), ".\n"; } print "\n"; close $cell_outputfh; my @wsnames; my @row_mins; my @row_maxs; my @col_mins; my @col_maxs; for my $worksheet ( $workbook->worksheets() ) { push @wsnames, $worksheet->get_name(); my ( $row_min, $row_max ) = $worksheet->row_range(); my ( $col_min, $col_max ) = $worksheet->col_range(); push @row_mins, $row_min; push @row_maxs, $row_max; push @col_mins, $col_min; push @col_maxs, $col_max; } undef $workbook; undef $xls_parser; for (my $j=0;$j < scalar(@wsnames) ;$j++ ) { print $wsnames[$j]."*"; open ( $cell_outputfh, "<:encoding(iso-8859-1)", $ribbon_srcge +o[$i].".csv" ) or die " open failed on $ribbon_srcgeo[$i].csv $!"; my %HofA_sheet_cells; # make has out of cells while (<$cell_outputfh>) { my @fields = split /","/, $_; $fields[0] =~ s/^"//; $fields[3] =~ s/"$//; if( $fields[0] eq $wsnames[$j] ) { $HofA_sheet_cells{$wsnames[$j]}[$fields[1]][$fields[2] +] = $fields[3]; $dot_ctr++; if ( $dot_ctr == 1000) { $| = 1; #flush the buffer print "*"; $dot_ctr=0; } } } undef %HofA_sheet_cells; close $cell_outputfh; } } sub HH_cell_handler { my $workbook = $_[0]; my $sheet_index = $_[1]; my $row = $_[2]; my $col = $_[3]; my $cell = $_[4]; my $worksheet = $workbook->worksheet($sheet_index); my $wsname=$worksheet->get_name(); my $value='"'.$wsname.'"'.','.'"'.$row.'"'.','.'"'.$col.'"'.','.'" +'.$cell->value().'"'."\n"; print $cell_outputfh $value; }

In reply to Re^4: memory usage Spreadsheet::ParseExcel by Anonymous Monk
in thread memory usage Spreadsheet::ParseExcel by Anonymous Monk

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.