my @a = ( 1..3, 2..3, 6, 8..9); my $last_element = ""; my @sorted_aray = sort(@a); foreach $i (@aorted_array){ if ($last_element ne $i){ print $i; $last_element = $i; } }
Enjoy!
Dageek
In reply to Re: finding the distinct elements in an array
by johndageek
in thread finding the distinct elements in an array
by beginr
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |