Test11
Test12
test13
test14
Test21
2 3 4
#### #!/usr/bin/perl use strict; use CGI ':standard'; use HTML::TagParser; my @Body; my $html=HTML::TagParser->new('table.txt'); my @elem=$html->getElementsByTagName("table"); foreach my $parent(@elem){ my $text=$parent->innerText(); my $tag=$parent->tagName; my $get=$parent->childNodes(); if (@$get){push @Body,digChild(@$get);} push @Body,"<$tag>$text"; } #foreach parent print header,start_html('table'); print join("\n",@Body)."\n"; print end_html; sub digChild { my @ar=@_; foreach my $row(@ar){ my $tag=$row->tagName; my $txt=$row->innerText; my $c=$row->childNodes(); if (@$c){push @Body,digChild(@$c);} return "<$tag>$txt"; } # foreach row } # sub