in reply to Foreach loop not looping?!

If your arrays @orders contains just one item that is a hash ref you'll get that behaviour.

With arrays I always use print Dumper(\@array); for clarity.