Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: processing key value pairs of a hash

by kwaping (Priest)
on Apr 14, 2009 at 21:18 UTC ( #757495=note: print w/ replies, xml ) Need Help??


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.

# 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" . $/; } }
I am ignoring the minor issues with your code that others have pointed out.

---
It's all fine and dandy until someone has to look at the code.


Comment on Re: processing key value pairs of a hash
Select or Download Code
Re^2: processing key value pairs of a hash
by lomSpace (Scribe) on Apr 15, 2009 at 15:04 UTC
    Kwaping
    Thanks for the direction!
    LomSpace

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://757495]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (6)
As of 2015-07-04 23:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (60 votes), past polls