Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: finding matches in the same array

by RazorbladeBidet (Friar)
on Apr 13, 2005 at 17:06 UTC ( #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? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (2)
As of 2023-03-28 20:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which type of climate do you prefer to live in?






    Results (69 votes). Check out past polls.

    Notices?