Here s my problem (which I can't solve since a long long tiiiime), I can live with it but I was wondering if it could be solved :)
1/ I have a perl script reading a XML file :2/ I read it this way :<conf name="snoopdogg" serial="1" target="172.16.1.3"> <services> <service name="cpu"> <plugins> <plugin name="cpu" target="172.16.1.3" schedule="60"> <probes> <probe name="load1"> <warn value="4" operator=">"/> <crit value="10" operator=">"/> </probe> (...)
The problem is the following : I want to access a probe's warn value, to do so I have to :my $configuration = $xml->XMLin( $conf, GroupTags => { services => 'service', plugins => 'plugin', probes => 'probe' }, ForceArray => [ qw(service plugin probe) ], KeyAttr => { 'service' => 'name', 'plugin' => 'name', 'probe' => 'name' }, KeepRoot => 0 );
What I would like is to access the value this way :my $warn = $configuration->{snoopdogg}{services}{cpu}{plugins}{cpu}{pr +obes}{load1}{warn}{value};
Is there a way with XML::Simple to achieve something likemy $warn = $configuration->{snoopdogg}{cpu}{cpu}{load1}{warn}{value};
Thank you very much ! :)GroupTags => { services => 'service' => name }
In reply to Question about XML::Simple by euz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |