in reply to Foreach hash of array

You are getting a bad response because your questions are not clear and do not show any actual attempt to solve the problem.

You will get a better result if you clearly state what your goal is, show a sample of failed code, and describe the error/bad result from your attempt. Read the How (Not) to Ask a Question node linked elsewhere in the thread.

For example, if you had said, "I need to iterate over the array reference stored in the 'Fruits' key and find all cases where the grandchild key is 'Orange'. Here's what I've tried: ... some code goes here...", you would probably have an answer by now.

Your questions make giving you the answer you want impossible. Nobody really knows what you really want. Someone might hit on it in with a lucky guess, but do you want to rely on an improbable chance?

Here's where I take a guess at helping you. Your variable name is '$xml'. Are you getting this data structure from an XML file? It's a needlessly complex structure. What tools are you using to parse the XML? Maybe a different library would be helpful. There are tons of libraries for XML munging that may make solving your problem trivial. If the data doesn't come from an XML file, you may wish to change your variable name, and simplify the data structure.

Update: Take a look at Iterating over an array variable times for an example of an unclear question followed up by a good problem statement.


TGI says moo