in reply to Unique value count in hash not working properly

I haven't done a counter in ages:). Would this help?
#!/usr/bin/perl -slw use strict; my %count; my(@dates) = ( 9.1.11, 9.2.11, 9.3.11, 9.4.11, 9.5.11 ); foreach my $batch_dates (@dates) { ++$count{$_} foreach (@dates); sleep 1; print $count{$batch_dates}; }
Update: I added List::MoreUtils for a unique counter:
#!/usr/bin/perl -slw use strict; use List::MoreUtils qw(uniq); my %count; my (@nums) = uniq 9.2.11, 9.2.11, 9.2.11, 9.4.11, 9.5.11; foreach my $num (@nums) { ++$count{$_} foreach (@nums); sleep 1; print $count{$num}; }