in reply to Grouping Data

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.