in reply to Summarize or Consolidate array by value?

If you want to preserve the order, use the following:
my @array = qw( a a b c d d ); my %counts; my @keys = grep { !($counts{$_}++) } @array; print("$_: $counts{$_}\n") foreach @keys;