On Jun 2, 12:37 am, [email protected] (Gopal Karunakar) wrote:
> Hi All,
>
> I needed to find all the duplicate values in an array and their count of
> occurences. Any help would be appreciated .
>
See: perldoc -q dup
perldoc perlvar
Although even non-dup array members get printed,
Data::Dumper and perl's pre-defined @ARGV can
be handy. Just pass the actual array members to
perl as command line arguments:
perl -MData::Dumper -e '$seen{$_}++ for @ARGV;
print Dumper \%seen'
foo bar bat foo
--
Charles DeRykus
--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
http://learn.perl.org/