in reply to Counting within an array

awk '{ print $0(++a[$0]) }'
Just kidding. Use the perl solution above instead.