in reply to remove duplicate value in array

This is also found under Categorized Questions and Answers:

HTH,

planetscape

Replies are listed 'Best First'.
Re^2: remove duplicate value in array
by Anonymous Monk on Jul 03, 2015 at 11:54 UTC
    @content = qw(1 2 3 1 2 4 2 5 4 3); print "arr @content\n"; for ($i=0; $i<=$#content; $i++) { my $count = 0; for ($j=$i+1; $j<$#content+1; $j++) { if ($content[$i] == $content[$j]) { $count++; } if ($content[$i] == $content[$j] && $count == 1) { $content[$j] = ""; } } } print "@content";

    Code tags added by GrandFather