in reply to calculating frequency of item in an array

I think you want something like this:

my %freq; $freq{$_}++ for @items; foreach (sort { $freq{$b} <=> $freq{$a} } keys %freq) { print "$_ : $freq{$_}\n"; }
--
<http://www.dave.org.uk>

"The first rule of Perl club is you do not talk about Perl club."
-- Chip Salzenberg