#!/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);
In reply to Re: extract number of times a value appears in an array
by leocharre
in thread extract number of times a value appears in an array
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |