(the number 45 is duplicated here, but only one appears in the output).use strict; use warnings; my %uniq; my @array = sort {$a <=> $b} grep {$uniq{$_}++==0} qw/ 23 45 12 4 45 8 + 7 5/; while (my $item = shift @array) { print "$item $_\n" for @array; }
All power corrupts, but we need electricity.
In reply to Re^2: Compare each array element to the rest, sequentially
by NetWallah
in thread Compare each array element to the rest, sequentially
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |