filenames as 508.ids.xml 1508.ids.xml 1509.id123.xml 1400.id123.xml #### #!/usr/bin/perl use XML::Simple; use ContentHelper; use XML::Parser; @files = `ls`; # Sub substitution to check for duplicates foreach $input_file (@grepNames){ chomp $input_file; my $xml_parser = XML::Simple->new(); my $data = $xml_parser->XMLin($input_file); my $Id = $data->{"root"}->{'id'}; my $date = $data->{'root'}->{'date'}; my $time = $data->{'root'}->{'time'}; ### Please tell me how to add the condition here. print "$input_file:$Id:$time:$date\n\n"; } #### The above print command prints 9890.ids.xml:ids:70857:2004-10-02 9893.ids.xml:ids:70859:2004-10-02 9830.ids.xml:ids:2000:2004-10-02 9834.ids.xml:ids:4000:2004-10-01