my %found; while ( my $item = find_next_number() ) { $found{$item}=1; } @array = map { "$_.found" } sort {$a <=> $b} keys %found;