while(my $k = each %$structure) { for my $field (@fields){ print qq{$field = $structure->{$field}\n }; } }