in reply to Re^2: Search multiple variables
in thread Search multiple variables
Put another loop around the loop over the diagnoses:
my @Search = qw( 6280 3141 2718 1414 ); my %frequency; for my $Search (@Search) { for my $diag ( keys %diags ) { if( my @found = grep { $_ eq $Search } @{$diags{$diag}} ) { my $found = join ",", @found; print "Primary diagnosis: $diag, $found\n"; $frequency{$Search}++; } } }
and then do something based on the %frequency of found diagnoses.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Search multiple variables
by Raya4505 (Novice) on Feb 25, 2014 at 15:14 UTC | |
by hdb (Monsignor) on Feb 25, 2014 at 15:24 UTC |