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!


In reply to Re^6: Putting Hash values into an array by Raya4505
in thread Putting Hash values into an array by Raya4505

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.