in reply to Problem parsing SOAP::SOM result of SOAP::Lite client Query - Not a HASH reference

Hi

I didn't look at the whole problem, sorry. But if you want to react in your code to changing structures at runtime you can use the possiblilies of introspection:

if(ref $somthing && ref $something eq 'HASH') { # iterate over keys } elsif (ref $somthing && ref $something eq 'ARRAY') { # iterate over list } else { # do whatever you want }

I hope it's an idea to help yourself

Best regards
McA

  • Comment on Re: Problem parsing SOAP::SOM result of SOAP::Lite client Query - Not a HASH reference
  • Download Code

Replies are listed 'Best First'.
Re^2: Problem parsing SOAP::SOM result of SOAP::Lite client Query - Not a HASH reference
by Anonymous Monk on Sep 27, 2012 at 13:14 UTC

    Thanks for the input. I didn't realize you could do that. I know that the data structure will be the same with regards to ARRAY vs. HASH. I pretty sure the problem is due to my code trying to access the same data that's in two (or more) locations (which I'll have to access each of them to create a new line of text output.) I'm pretty sure I'll need to use nested foreach statements. I'm just having trouble figuring out how to do this with this wierd data structure that has hashes and arrays and bless statements...