in reply to Basic parsing XML perl - using FOREACH

Not a direct answer to your question, but you probably want to use another module for parsing your XML. You might want to look at what other monks have to say about XML::Simple: http://www.perlmonks.org/?node_id=1150844.