in reply to Array: inserting what isn't there
Sounds more like a hash problem than an array problem. This will give you the array you are looking for.
my %found; while ( my $item = find_next_number() ) { $found{$item}=1; } @array = map { "$_.found" } sort {$a <=> $b} keys %found;
In Section
Seekers of Perl Wisdom