in reply to Count duplicates in array.

Or

#! perl -slw use strict; my @array = ('bent', 'svend', 'gert','pete','svend','pete'); my ($temp, $count) = ("@array", 0); ($count = $temp =~ s/($_)//g) and printf "%2d:%s\n", $count, $_ for @a +rray; __END__ c:\test>213719 1:bent 2:svend 1:gert 2:pete c:\test>

Okay you lot, get your wings on the left, halos on the right. It's one size fits all, and "No!", you can't have a different color.
Pick up your cloud down the end and "Yes" if you get allocated a grey one they are a bit damp under foot, but someone has to get them.
Get used to the wings fast cos its an 8 hour day...unless the Govenor calls for a cyclone or hurricane, in which case 16 hour shifts are mandatory.
Just be grateful that you arrived just as the tornado season finished. Them buggers are real work.

Replies are listed 'Best First'.
Re^2: Count duplicates in array.
by ravi45722 (Pilgrim) on Sep 08, 2015 at 05:54 UTC

    It's working but i have some other need. My array is like this.

    @array=('SMSC_absentsubscriberSM','SMSC_absentsubscriberSM_SC_1','SMSC +_absentsubscriberSM_SC_2','SMSC_absentsubscriberSM',....and so on);

    Please suggest me to find exact duplicate in the array. Thanking you