#!/opt/local/bin/perl

use strict;

use XML::Simple;
use Data::Dumper;

my $xs = XML::Simple->new(ForceArray => ['event']);

check("eventconf.xml");
my $path = "./events";
opendir my $dir, $path or die "Can't open $path\n";
my @files = grep /\.xml$/, readdir $dir;
closedir $dir;
foreach my $file (@files) {
    check("$path/$file");
}

sub check {
    my $file = shift @_;
    my $xml = $xs->XMLin($file);
    return unless $xml;
    foreach my $e (@{$xml->{event}}) {
        print "$file:$e->{uei}\n" unless $e->{'event-label'};
    }
}

