I recently got assigned some projects that use PERL, and I have no experience with it so I'm flying solo here. So I apologize in advance for using the wrong terminology or not clarifying my question.

I have a section of code that groups records by diagnosis codes. Right now it groups anything that has a specific code number, but now I need to create a group of "everything else". Here's the current code. I need to change the Unspecified group to include everything not included in group A or group B, instead of having to list each one as I can have up to 100+ different diagnosis codes each time. The diagnosis codes are a text field, if that makes a difference, and some have numbers and letters.

@DiagGroupA = qw(2770 27700 27701 27702 27703 27707 27709); @DiagGroupB = qw(277); @UNSPECIFIED = qw(0704 07049); foreach $diagnosis (@DiagGroupA) { $DiagGroupA_list{$diagnosis} = 1; } foreach $diagnosis (@DiagGroupB) { $DiagGroupB_list{$diagnosis} = 1; } foreach $diagnosis (@UNSPECIFIED) { #$DiagUNSPECIFIED_list{$diagnosis} = 1;

In reply to Grouping Data by okieheart

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.