in reply to Camel vs. Gopher

Wait, did you say "short and fast and Perl"? One-liner, then?

$ time perl -MPDL -e 'print transpose pdl long hist +(10*random 1e7),0 +,10,1' [ [ 0 998557] [ 1 998651] [ 2 1000878] [ 3 1001181] [ 4 1000788] [ 5 1000577] [ 6 1000108] [ 7 999979] [ 8 997430] [ 9 1001851] ] real 0m0.290s user 0m0.215s sys 0m0.074s

Well, twice as slow as kschwab's code, but isn't he a cheater: you asked to "generate 10 million random integers", and only then "count the occurrence of each". If you ask where are integers above -- bin centers effectively "floor" random numbers in each bin, to bin's lower limit.

P.S. Generating explicit integers as

$ time perl -MPDL -e 'print transpose pdl long hist +(byte 10*random 1e7),0,10,1'

is only very slightly longer (in both length and time).