in reply to Help fixing this piece of code

This assumes unimodal datasets:

sub mode{ my %h; ++$h{ $_ } for @_; return ( sort{ $h{ $b } <=> $h{ $a } } keys %h )[ 0 ] };; @data = qw[2 3 3 3 5 7 8 12 32 44 55 12 3 23 43 33 1 4 25 43 42 1 4 5 +3 3 3];; print mode( @data );; 3

You'd need to so a bit more work to discover bi/multimodal datasets.


Anyone got any experience of this phone's predecessor?

With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority". I knew I was on the right track :)
In the absence of evidence, opinion is indistinguishable from prejudice.
I'm with torvalds on this Agile (and TDD) debunked I told'em LLVM was the way to go. But did they listen!