in reply to Re^5: Putting Hash values into an array
in thread Putting Hash values into an array
First of all, you are amazing. Thank you for your help. One thing I didn't put in my example and should have, is some of the diagnosis codes in my arrays start with a letter (e.g., V21564, c5415). So, I am struggling with your lines that say:
for (sort { $a <=> $b } keys %{ $Diags{$key} } ) { if (exists $DiagCodes{$_}) { printf $fh1 " %s: %d, %d\n", $DiagNames{ $DiagCodes{$_} }, $_, $Diags{$key}->{$_}; } else { printf $fh1 " Unrecognized code: %d\n", $_; } }
because they are set up for a numeric value with the <=>, so I changed it to:
foreach (sort {$a cmp $b} keys %{$Diags}$key}})
I tried some other things, but that is the one with the least errors, although it is still not running through. I PROMISE this will be the last question I ask for a long time!! Any insight you can give would be amazing!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^7: Putting Hash values into an array
by Athanasius (Archbishop) on Mar 07, 2014 at 02:37 UTC | |
by Raya4505 (Novice) on Mar 07, 2014 at 21:16 UTC |