in reply to Html - dynamic array
I don't know what you think that does, but it doesn't do it! I strongly recommend that you always use strictures (use strict; use warnings;). Under strictures the line containing ${$arr_name{$pages}}[$rws]=\@row_ele; generates the error:
Global symbol "%arr_name" requires explicit package name at ...
What you are achieving is autovivifying an entry in the package hash %arr_name. Over time your script will accumulate a hash entry for each page. If something of that sort is your intent then it would be better written using an explicit array of array (AOA):
use strict; use warnings; use HTML::TableExtract; my $te = HTML::TableExtract->new ( keep_headers => ["Customers", "Samples", "Violations", "Availabili +ty"] ); $te->parse ($final_content); my @pages; foreach my $ts ($te->tables ()) { print "Table Number(", join (',', $ts->coords), "):\n"; $rws = 0; push @pages, []; foreach $row ($ts->rows) { my @row_ele = split /,/, join ",", @$row; push @{$pages[-1]}, \@row_ele; print scalar @pages, ',', scalar @{$pages[-1]}, "\n"; } }
|
---|