my $reportdate;
my $tp = HTML::TokeParser->new($sourcefile) or die "Unable to open meg.out: $!";
#The report date is embedded inside a form as a subtitle.
#Therefore, find the form called calendarForm and then look
#for a
tag which contains the date
while (my $tag = $tp->get_tag("form")) {
my ($tagname, $attr, $attrseq, $rawtxt) = @{ $tag };
if ($rawtxt =~ /calendarForm/) {
while ( my $tag = $tp->get_tag("td")) {
my ($tagname, $attr, $attrseq, $rawtxt) = @{ $tag };
if ($rawtxt =~ /subTitle/) {
$reportdate = $tp->get_trimmed_text("/td");
print "report date =" . $reportdate . "\n";
last;
}
}
}
}
|