my %thisrecord = map { $columns[$_] => $fields[$_] } ( 0 .. $#fields ); #### @thisrecord{@columns} = @fields; #### for my $items (sort {$b->{Estimated_Value} <=> $a->{Estimated_Value}} @data) { ... }