for (@cols) { (my $changed = $_) =~ tr/_/,/; printf("%s,%f\n", $changed, $avgsHash{$_}); }