sub RainSoFarMessage{
my $month = shift;
$pattern = "$month-";
my $xp = XML::XPath->new(filename
=> 'weather_records.xml');
my @result = ();
my @totrain=();
my $nodes = $xp->findnodes("//MonthlyWeatherRecord
[contains(date,'$pattern')]");
foreach my $node($nodes->get_nodelist){
push @totrain,$xp->findvalue(".//totalrainfall/
\@number",$node);
}
my $total=0;
foreach my $t(@totrain){
$total=$total + $t;
print "\n$total";
}
push @result [$month,$total];
return \@result;
}
####
Over 40.0 extremelyhot
35.0 to 39.9 veryhot
30.0 to 34.9 hot
25.0 to 29.9 verywarm
####
1-2-2004
5-2-2004
'verywarm'
####
1-2004
-