Find duplicates in an array

2010-06-02 Thread Gopal Karunakar
Hi All, I needed to find all the duplicate values in an array and their count of occurences. Any help would be appreciated . Thanks in advance.

AW: Find duplicates in an array

2010-06-02 Thread Thomas Bätzler
Gopal Karunakar gk.kalipuray...@gmail.com asked: I needed to find all the duplicate values in an array and their count of occurences. Any help would be appreciated . #!/usr/bin/perl -w use strict; my @array=qw(foo baz bar foo baz foo); my %seen; foreach my $item (@array){ $seen{$item}++ }

RE: Find duplicates in an array

2010-06-02 Thread Taylor, Andrew (ASPIRE)
I needed to find all the duplicate values in an array and their count of occurences. Any help would be appreciated . You could use a hash: use strict; use warnings; my @animals = (cat,dog,wombat,cat,monkey,cat,monkey); my %howmany; foreach my $critter (@animals) { $howmany{$critter}++; }

Re: Here Docs

2010-06-02 Thread Jenda Krynicky
From: Uri Guttman u...@stemsystems.com JK == Jenda Krynicky je...@krynicky.cz writes: JK From: Joseph L. Casale jcas...@activenetwerx.com Inside a here doc, how can I force an expression to be evaluated such as localtime: here docs are just a different form of string so any

Re: Find duplicates in an array

2010-06-02 Thread C.DeRykus
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,

Using Archive::Zip to compress two directories into a single zip file

2010-06-02 Thread Chap Harrison
Well, I suppose I've missed a subtlety along the way here. I have two directories: /path/to/existing/directory/foo/ /path/to/existing/directory/bar/ And I want to archive these two directories into a zip file named archive.zip. Here's what I did, using the synopsis of Archive::Zip in CPAN as

Re: Using Archive::Zip to compress two directories into a single zip file

2010-06-02 Thread John W. Krahn
Chap Harrison wrote: Well, I suppose I've missed a subtlety along the way here. I have two directories: /path/to/existing/directory/foo/ /path/to/existing/directory/bar/ And I want to archive these two directories into a zip file named archive.zip. Here's what I did, using the synopsis of