PerlKitten has asked for the wisdom of the Perl Monks concerning the following question:
Suppose I want to find the number of values falling above a certain level for each person, and assign it to a hash of its own. I'd like to use Grep, but there's apparently a syntax problem:
Can someone help me fix this? Thanks a million!my @personlist=("1"..."1000") my ($person,%high_temp_days); foreach $person (@personlist) { %high_temp_days{$person}=grep {$_>300} values %BodyTemp{$person}; #the above two lines are one line }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to extract a row or column of two-dimensional hash
by toolic (Bishop) on Jan 11, 2008 at 20:32 UTC | |
by PerlKitten (Novice) on Jan 11, 2008 at 21:01 UTC | |
by merlyn (Sage) on Jan 11, 2008 at 21:37 UTC | |
by toolic (Bishop) on Jan 11, 2008 at 21:56 UTC | |
by PerlKitten (Novice) on Jan 15, 2008 at 03:51 UTC | |
|
Re: How to extract a row or column of two-dimensional hash
by locked_user sundialsvc4 (Abbot) on Jan 11, 2008 at 20:16 UTC | |
by PerlKitten (Novice) on Jan 11, 2008 at 20:32 UTC |