in reply to processing key value pairs of a hash
Here's my answer, building on the code you have already posted to create %clone_hash.
---
It's all fine and dandy until someone has to look at the code.
I am ignoring the minor issues with your code that others have pointed out.# build the data my %count; while (my ($test,$result) = each %clone_hash) { $count{$test}{passed}++ unless ($result =~ /pass4|fail/); } # check the data foreach my $test (keys %count) { if (! $count{$test}{passed}) { print "test $test had no passing results" . $/; } elsif ($count{$test}{passed} == 1) { print "test $test had only one passing result" . $/; } }
---
It's all fine and dandy until someone has to look at the code.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: processing key value pairs of a hash
by lomSpace (Scribe) on Apr 15, 2009 at 15:04 UTC |
In Section
Seekers of Perl Wisdom