http://www.perlmonks.org?node_id=860416

manu_06 has asked for the wisdom of the Perl Monks concerning the following question:

Hi,

I have bunch of XML files where using perl I have to read each file one by one and check certain tag values and if the values do not match print the filename and tag name to an output file. My script below is checking the the tag values and printing match or not match. Now I got stuck with how to print the filename and tag name if there is no match and also instead of single file declaration a path should be declared so that it can read all the files. Can I get some help regarding this.

#!/usr/local/bin/perl-w use XML::Simple; my $xml = XML::Simple->new; my $file = $xml->XMLin('IMD025350802_000001.xml') or die$!; if (($file->{identification}{'identity'}{'format'} eq 'JPEG File Inter +change Format') && ($file->{filestatus}{'well-formed'}{'content'} eq 'true') && ($file->{ +filestatus}{'valid'}{'content'} eq 'true')) { print "match"; } else { print "not match" }