in reply to Elements in array
use Data::Dumper; my @array = ( 'a', 'b', 'c', 'a', 'b' ); # Iterate through array and increment hash element indexed # by the array element - As each hash element must be # unique, this allows for a count of each unique array # element to be easily generated. # my %hash; $hash{$_}++ for @array; print Data::Dumper::Dumper( \%hash );
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Elements in array
by ph0enix (Friar) on May 17, 2002 at 16:03 UTC |