in reply to Finding the lowest available UIDs

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

Replies are listed 'Best First'.
Re^2: Finding the lowest available UIDs
by Your Mother (Archbishop) on Nov 11, 2008 at 22:58 UTC

    On OS X this gives-

    Out of memory during array extend at - line 3.
      If your UIDs get too high, either add a test in the loop (no need to do anything if the UID is above 250), or use a hash instead of an array.

        I know. :) I was remarking upon the suitability of posting an open ended while statement without such a test or safety valve. In the interests of full disclosure: I brought down a production server (internal, anyway) once with a similar snippet. So the beam in my eye is substantial.