in reply to Decipher HASH from XML

Your issue is that Perl does not like hash keys in the form 'foo.bar' - if you don't quote the 'foo.bar' it is FUBAR.

$hash = { 'foo.bar' => 'foo.bar_v', 'foobar' => 'foobar_v' }; print $hash->{foo.bar}; __DATA__ foobar_v <-- note we have lost the . in the key so get the wrong val +ue

You get at the data as shown by quoting the 'str.str' keys so as to avoid the issue.

$VAR1 = { 'wellmed' => { 'wellmedack' => {}, 'wellmed.ack' => { 'errors' => '0', 'wellmed.response' => 'User da +ta updated for ID: aac20fd41e07ea11d9bfc1ac192a16aa77', 'responses' => '1' } } }; print "Response: ", $VAR1->{'wellmed'}->{'wellmed.ack'}->{'wellmed.res +ponse'}, "\nErrors: ", $VAR1->{'wellmed'}->{'wellmed.ack'}->{'errors'},

cheers

tachyon

Replies are listed 'Best First'.
Re^2: Decipher HASH from XML
by Hammy (Scribe) on Sep 24, 2004 at 12:00 UTC
    Thank you again, I made the change to replace the "." with another character and everything worked like a charm.