Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: finding matches in the same array

by RazorbladeBidet (Friar)
on Apr 13, 2005 at 17:06 UTC ( [id://447509]=note: print w/replies, xml ) Need Help??


in reply to finding matches in the same array

Here's another idea... a little convoluted...there's probably a nicer way to write it
$hash{$_} = [ ( $hash{$_}->[0] || 0 ) + $numbers[$i++], ( $hash{$_}->[1] || 0 ) + 1 ] foreach @sequence; print $_, ( $hash{$_}->[0] / $hash{$_}->[1] ) foreach keys %hash;
--------------
"But what of all those sweet words you spoke in private?"
"Oh that's just what we call pillow talk, baby, that's all."

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (8)
As of 2024-04-23 12:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found