count ContributionType
authorDobrica Pavlinusic <dpavlin@rot13.org>
Wed, 16 Mar 2016 22:40:33 +0000 (23:40 +0100)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Wed, 16 Mar 2016 22:40:33 +0000 (23:40 +0100)
star2016-abstracts.pl

index bda55b1..2d872c3 100755 (executable)
@@ -7,5 +7,19 @@ use Data::Dump qw(dump);
 my $tpp = XML::TreePP->new();
 my $tree = $tpp->parsefile( "abstracts.xml" );
 
-print dump($tree);
+my $abstracts = delete $tree->{AbstractBook}->{abstract};
 
+warn "# tree = ", dump($tree);
+
+my $stat;
+
+foreach my $abstract ( @$abstracts ) {
+       warn "# abstract = ", dump($abstract);
+
+       foreach $k (qw( ContributionType )) {
+               $stat->{$k}->{ $abstract->{$k} } ++;
+       }
+
+}
+
+warn "# stat = ",dump($stat);