I have gone through the perlfaq4 ,but I am really struggling to get the correct logic to compare two array reference and only display matching records...
Its also says use of Hash, so do i need to change Hash ...as im already having array of hash..
please correct me ..
#!/usr/bin/env perl
use strict;
use warnings;
use XML::XPath;
use Data::Dumper;
my @records;
my @eventrecords;
my $eventxml = 'events.xml';
my $evenxp = XML::XPath->new(filename => $eventxml);
my $evennodeset = $evenxp->findnodes('//event');
my $xml = 'ApplicationList.xml';
my $xp = XML::XPath->new(filename => $xml);
my $nodeset = $xp->findnodes('//application_list');
foreach my $evennode ($evennodeset->get_nodelist) {
my $evenssrid = $evenxp->find("./custom_attribute_list/custom_
+attribute[normalize-space(name)='SSRID']/value", $evennode);
s/^\s+|\s+$//g for $evenssrid;
push @eventrecords, {eventid => $evenssrid};
}
print Dumper \@eventrecords;
foreach ($xp->findnodes('/application_list/application/@id') ) {
my $appid = $_->string_value;
$appid =~ s/^\s+|\s+$//g;
push @records,
{appid => $appid
};
}
print Dumper \@records;
|