in reply to Using HTML::Parser extract text from tables
In _start:my $tablenr=0;
In _end:if ($tag eq 'table'){ push @save, [$tablenr,$row,$column]; $row = $column = 0; $tablenr=$count; ++$count; $in_table++; }
In Text:if ($tag eq 'table') { ($tablenr, $row, $column) = @{ pop @save }; --$in_table; }
You might want to add an initialization of @save as well, to avoid trying to der eference an undefined value when you leave a toplevel table. Something like this perhaps:$table[$tablenr][$row][$column] .= $text if ($in_table) && ($text !~ m +/^\s+$/);
Regards, GoldClawmy @save=([]); #initialize with an empty list as first element.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Using HTML::Parser extract text from tables
by zzspectrez (Hermit) on Jan 18, 2001 at 12:07 UTC | |
|
Re: Re: Using HTML::Parser extract text from tables
by zzspectrez (Hermit) on Jan 17, 2001 at 06:28 UTC | |
by Anonymous Monk on Jan 17, 2001 at 15:45 UTC |