foreach my $line (@{$offers->{'offers'}{'offer'}}) { foreach my $row (sort keys %$line) { print $line->{$row} . "\t"; } print "\n"; }