i expect the server elements to be put into an array. this is my perl
What exactly do you mean by that? Can you post a
shortened example of what you want the structure to look like?
Based on a best guess of what you meant I changed my
code to look like:
#!/usr/bin/perl -w
use strict;
use XML::Simple;
use Data::Dumper;
my $stuff=XMLin(undef,KeyAttr=>['server']);
print Dumper($stuff);
which then takes the server element and treats everything
enclosed by that as an array. Is that what you were after?
Short sample of the structure:
$VAR1 = {
'server' => [
{
'location' => 'atlanta',
'name' => 'cns04-fs16',
'event' => {
'sparedata' => 'Disk on cns04-fs16
+at WARNING level',
'entry' => {
'color' => 'yellow',
'desc' => '/mail/vol/cns
+04-fs16 (9 3%) has reached the defined disk space WARNING level (92%)
+'
},
'received_by' => '10.10.10.10',
'name' => 'disk',
'state' => {
'name' => 'online',
'data' => {}
},
'received_at' => 'Thu Mar 30 15:03:
+16 EST 200 6',
'length' => '6.43 days',
'color' => 'yellow'
},
'grouping' => {
'secondary' => 'Mail Filers',
'primary' => 'Storage Servers'
}
},
Peter L. Berghold -- Unix Professional
Peter -at- Berghold -dot- Net; AOL IM redcowdawg Yahoo IM: blue_cowdawg
|