masil has asked for the wisdom of the Perl Monks concerning the following question:

Hi Gurus, I have a program to decode RPCXML. here is the sample. how can i print individual values in the script
use strict; use Frontier::RPC2; use Data::Dumper; my $coder = Frontier::RPC2->new; my $xml_string="<?xml version=\"1.0\" encoding=\"UTF-8\"?> <methodCall> <methodName>Refill</methodName> <params> <param> <value> <struct> <member> <name>originHostName</name> <value> <string>host</string> </value> </member> <member> <name>originNodeType</name> <value> <string>EXT</string> </value> </member> <member> <name>voucherActivationCode</name> <value> <string>39393939393</string> </value> </member> <member> <name>subscriberNumberNAI</name> <value><i4>2</i4></value> </member> </struct> </value> </param> </params> </methodCall> "; my $key; my $value; my $call = $coder->decode($xml_string); my %coins = Dumper($call);#->{'value'}->{'originHostName'}; print $coins{'originHostName'};

Replies are listed 'Best First'.
Re: HASH problem
by Corion (Patriarch) on Aug 11, 2011 at 11:01 UTC

    You don't tell us what the problem is, but where in the documentation of Data::Dumper did you find this usage:

    my %coins = Dumper($call);

    Please try to explain to us what this code sequence is supposed to do:

    my $call = $coder->decode($xml_string); my %coins = Dumper($call); print $coins{'originHostName'};
      Thanks for your reply. when I print $coins{'originHostName'};, I expect to have the output "host" but it is just blank

        Why do you expect Dumper() to populate your hash? Where in the documentation of Data::Dumper did you find this usage?