##########Sample input####### <?xml version="1.0" ?> <!DOCTYPE config SYSTEM "fefm_config.dtd"> <config> <server name="example_only" active="true"> <nas_repository_unc>\\corp.dummy.com\d +ev\General_CIFS_Workspace\MobileTest\dev\nas_rep</nas_repository_unc> <nas_archive_unc>\\corp.dummy.com\dev\General_CIFS_Wor +kspace\MobileTest\dev\nas_arc</nas_archive_unc> </server> <mod_minutes>0</mod_minutes> <variables> <variable> <name>email_report</name> <value>duser@dummy.com</value> </variable> </variables> </config> ######## Loading with ForceArray####### Log::Log4perl->easy_init({ # Log level: (DEBUG INFO WARN ERROR FATAL) level=>$DEBUG, layout=>'%d %H FEFM.%P %p > %m%n', file=>">>" . $mSettings->{err_file}, ForceArray => [ "server" ] }); $mLogger = get_logger(); ######### reading the hash ############### foreach my $server_name (@{$mSettings->{server}}) { my $this_srv = $mConf->{server}->{$server_name}; our_exit('SERVER') if(!defined $this_srv); if($this_srv->{active} ne 'true') { ##This is where i am getti +ng the error our_exit('ACTIVE'); next; # process next server }
In reply to XML::Simple ForceArray by dev2dev
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |