in reply to extract number of times a value appears in an array
#!/usr/bin/perl -w use strict; use Data::Dumper; my $count={}; my @a =qw(1 2 3 4 5 5 5 5); map { $count->{$_}++ } @a; print Dumper($count);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: extract number of times a value appears in an array
by davorg (Chancellor) on Aug 18, 2006 at 14:39 UTC |