Histogram generation Write the shortest program that generates a histogram (a graphical representation of the distribution of data).

Rules:


Must generate a histogram based on the character length of the words (punctuation included)
input into the program. (If a word is 4 letters long, the bar representing the number 4 increases by 1)
Must display bar labels that correlate with the character length the bars represent.
All characters must be accepted.
If the bars must be scaled, there needs to be some way that is shown in the histogram.


Examples:

$ ./histogram This is a hole in one!
1 |#
2 |##
3 |
4 |###

$./histogram Extensive word length should not be very problematic.
1 |
2 |#
3 |#
4 |##
5 |
6 |##
7 |
8 |
9 |#
10|
11|
12|#

./histogram Very long strings of words should be just as easy to generate a histogram just as short strings of words are easy to generate a histogram for.
1 |##
2 |#######
3 |#
4 |#######
5 |###
6 |#
7 |##
8 |##
9 |##
Python - 83 characters
Seems that we can take input from anywhere, so this takes input during execution, rather than from the command line, and uses Ejrb's suggestion to shorten it by 8.
s=map(len,raw_input().split())
c=0;exec'c+=1;print&quot;%3d|&quot;%c+&quot;#&quot;*s.count(c);'*max(s)

Python - 91 characters
This will fall over with quotes.
import sys;s=map(len,sys.argv[1:])
for i in range(1,max(s)+1):print&quot;%3d|&quot;%i+'#'*s.count(i)

Input:
&gt; python hist.py Please write a specification rather than giving a single example which, solely by virtue of being a single example, cannot express the range of acceptable output styles, and which doesnt guarantee to cover all corner cases. Its good to have a few test cases, but its even more important to have a good spec.

Output:
  1|#####
  2|######
  3|#####
  4|##########
  5|######
  6|#############
  7|####
  8|#
  9|##
 10|#
 11|
 12|
 13|#