in reply to Foreach loop not looping?!

Your first dump probably should've been (note the backslash)

print Dumper(\@orders);

If you pass an array (instead of an array ref) to Dumper, its individual elements are being dumped, which effectively produces the same output as your explicit looping...

Replies are listed 'Best First'.
Re^2: Foreach loop not looping?!
by rjberry (Novice) on Oct 09, 2008 at 14:43 UTC

    Ah right, thanks. I've done that but the output hasn't changed at all. I think this is something to do with @orders being taken from XML::Simple, which is apparently a pain in the arse for looping.

      ...but the output hasn't changed at all.

      Seems hard to believe :)  At least, a pair of outer brackets should've been added to the dump. Otherwise, it all depends on what exactly your @orders array contains (one or more elements, etc.).

      Perhaps showing some sample dumps (stripped down) would help shed light on what's going on...