in reply to XML::Simple parse attributes
use XML::Rules; my %results; my $parser=XML::Rules->new( rules => [ tc => sub { $results{ $_[1]->{result} }++; return }, _default => '', ], ); $parser->parse($conf); foreach my $result (sort keys %results) { print "$result: $results{$result}\n"; }
Why build a structure containing all the data from the XML if all you want to know are the counts of the different result attributes of the <tc> tag?
|
|---|