my @uids; while (my @list = getpwent) { $uids[$list[2]]++; } print $_ for grep {!$uids[$_]} 200 .. 250;