hi okieheart,
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
Just to settle a minor terminology point, the name of the language is Perl, not PERL. And, BTW, the name of the interpreter is perl.

Your question is not completely clear to me; for example, I do not know why or how @DiagGroupB is relevant to your question. Maybe you should try to boil down your example to what is useful for your problem. Showing more of the existing code might very much help.

Now, to simplify what I understand from your problem, I'll assume you have records in which one field is giving you the day of the week. You have categories for the weekdays, Monday through Friday (labeled mo, tu, we, th, fr) and your program is assigning your records to weekdays. Now, sometimes, for some obscure reasons, some records fall outside that range of categories, i.e. on weekend days.

You might create a param hash:

my %param = (mo => 1, tu =>1, ..., fr =>1);
Then, when you read the records, you store somewhere, say in a hash of arrays, records that have a day in the param hash, and in an @unspecified array those that are not in the param list. As an example:
my (%values, @unspecified); while (my $line = <$data_in>) { my $day = get_day($line); # some function to get the day of week f +rom the record if (exists $param{$day) { push @{$values{$day}}, $line; } else { push @unspecified, $line; } }
I hope that this helps.

In reply to Re: Grouping Data by Laurent_R
in thread 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.