in reply to Problem using module XML::Simple

The element you're looking for isn't where you think it is. Use Data::Dumper (or a similar module) to help visualize the parsed data structure.

Your script and XML::Simple is parsing your data into this structure (viewed using Data::Dumper):

$VAR1 = { 'WhicsService' => { 'Parameters' => { 'Service' => { 'Server +sMin' => { + 'Detail' => 'Minimu m number of servers running on WHICS', + 'Value' => '7' + }, 'comman +d' => { + 'Detail' => 'Unix comm and required to run WR81B', + 'Value' => 'cd /whics/ ahm && ./bin/wh_wweb80.sh ' + }, 'PortOu +t' => { + 'Detail' => 'Default p ort for Unix server connections', + 'Value' => '4100' + }, 'Name' +=> 'WR80B', 'WR80B' + => { + 'Runable' => {} + }, 'Runabl +e' => { + 'Detail' => 'Run WR80B process if value is yes else does not stat WR80B', + 'Value' => 'yes' + } }, 'ServersMax' => { 'Det +ail' => 'Maximum number of ser vers running on WHICS', 'Val +ue' => '15' }, 'WHICS' => { 'Detail' +=> 'Name of Unix system runnin g WHICS', 'Value' = +> '123.456.7.89' } } } };
In other words, the value you want is in:
$config->{WhicsService}{Parameters}{Service}{Runable}{Value}
(note that you can eliminate the dereferencing arrows (->) between the hash elements, as documented in perlref).

For more information about displaying complex data structures, see Re: How can I visualize my complex data structure?.

Update: added a couple links - thanks planetscape

Replies are listed 'Best First'.
Re^2: Problem using module XML::Simple
by davido (Cardinal) on Dec 05, 2005 at 05:40 UTC

    This is classic example of why one should use warnings;. Had the Original Poster used warnings, rather than failing silently Perl would have complained when the OP's script tried to concatenate an undefined value with "\n". This would have been a very good indication that the datastructure returned by XMLin() wasn't what he was expecting.

    The moral; use the tools that Perl offers; use strict;, use warnings;, and in the case of deciphering the datastructures returned by XML::Simple, be sure to use Data::Dumper;. Data::Dumper is the cheap and easy way to inspect a datastructure.


    Dave