sathish is a good bou
para
##
sathish
sathish is good boy or not
sathish is a good bou
/body>
#!/usr/bin/perl -w
use warnings;
use strict;
use XML::Simple;
use Data::Dumper;
my %hash;
my %hash1;
my $file= $ARGV[0];
my $simple = XML::Simple->new();
my $hash = $simple->XMLin($file);
my $file1= $ARGV[1];
my $hash1 = $simple->XMLin($file1);
print Dumper ($hash);
print Dumper ($hash1);
my $areEqual=1;
if(keys %hash == keys %hash1) {
foreach my $key(keys %hash) {
if(!exists $hash1{$key}) {
$areEqual=0;
last;
}
}
}
if($areEqual) {
print "ARE ";
}
else {
print "ARE NOT ";
}
for (keys %hash) {
$hash{$_} = $hash1{$_} if exists $hash1{$_};
}
print Dumper ($hash);
print Dumper($hash1);
$simple->XMLout($hash,
KeepRoot => 1,
OutputFile => 'pets.xml',
XMLDecl => "",
);
$simple->XMLout($hash1,
KeepRoot => 1,
OutputFile => 'pets1.xml',
XMLDecl => "",
);