On Jun 2, 12:37 am, gk.kalipuray...@gmail.com (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: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to