in reply to Re: Create unique array --the hard way!in thread Create unique array --the hard way!
if ( ! grep ( /^$element$/, @unique_array ) )
Great that you found a solution yourself
Since you didn't follow your own idea of using sorting to identify doubles the sort step is now useless.
To follow your original plan you would have to do something like this:
foreach my $element ( @sorted_array_q3 )
if ( $element ne $previous )
push( @unique_array, $element );
PerlMonks, of course - how could you ask?
Games & puzzles
Arts & music
Whichever pays my bills
Results (260 votes). Check out past polls.