#!/usr/local/bin/perl
# use module
use XML::Simple;
use Data::Dumper;
# create object
$xml = new XML::Simple;
# read XML file
$data = $xml->XMLin("DebugInfo.xml", ForceArray => 1);
# print output
#print Dumper($data);
#print Dumper($data->{'employee'}[0]);
#print Dumper($data->{'employee'}[1]);
$data1=$data->{'DebugInfo'};
#print @{$data1};
open FILE,">>debug.log";
foreach $item (@{$data1}){
print FILE "${$item}{UID}[0],";
print FILE "${$item}{ChannelID}[0],";
print FILE "${$item}{IPAddress}[0],";
if (${$item}{BufferMapString}[0] =~/^HASH/)
{print FILE ",n";}
else{print FILE "${$item}{BufferMapString}[0]n"};
}
close FILE;