You could use a hash of arrays
pojmy %pats_hoa=(); while (my $row = $sth->fetchrow_hashref){ my $voucher = delete $row->{'Voucher_Number'}; my $proc_code = delete $row->{'Procedure_Code'}; push @{$pats_hoa{$voucher}{$proc_code}},$row; } for my $voucher (sort keys %pats_hoa){ for my $proc (sort keys %{$pats_hoa{$voucher}}){ for my $rec (@{$pats_hoa{$voucher}{$proc}}){ if ($rec->{Transaction_Type} eq '???'){ # do something; } } } }
In reply to Re: Suggestions for handling a complex set of data
by poj
in thread Suggestions for handling a complex set of data
by sweetblood
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |