sivaramanm has asked for the wisdom of the Perl Monks concerning the following question:
hello monks,
I have a array, which values are duplicated once in the same array. I need to remove the second occurence value. I have tried as below, but not getting result. Pls help me to solve this
Thanks
Siva
@content = split(/ /, $content); @Original = @content; for ($i=0; $i<=$#content; $i++) { for ($j=0; $j<$i; $j++) { print "$j\n"; if ($content[$i] == $content[$j]) { $Original[$i] = ""; } } } print "@processing";
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: remove duplicate value in array
by borisz (Canon) on Jul 11, 2006 at 14:03 UTC | |
Re: remove duplicate value in array
by Nevtlathiel (Friar) on Jul 11, 2006 at 13:46 UTC | |
Re: remove duplicate value in array
by davorg (Chancellor) on Jul 11, 2006 at 13:47 UTC | |
by Anonymous Monk on Jan 14, 2009 at 09:22 UTC | |
Re: remove duplicate value in array
by Fletch (Bishop) on Jul 11, 2006 at 13:46 UTC | |
Re: remove duplicate value in array
by VSarkiss (Monsignor) on Jul 11, 2006 at 13:52 UTC | |
by ptum (Priest) on Jul 11, 2006 at 14:45 UTC | |
by ikegami (Patriarch) on Jul 11, 2006 at 22:01 UTC | |
Re: remove duplicate value in array
by McDarren (Abbot) on Jul 11, 2006 at 13:52 UTC | |
Re: remove duplicate value in array
by planetscape (Chancellor) on Jul 11, 2006 at 21:50 UTC | |
by Anonymous Monk on Jul 03, 2015 at 11:54 UTC | |
Re: remove duplicate value in array
by gasho (Beadle) on Jul 11, 2006 at 19:29 UTC |
Back to
Seekers of Perl Wisdom