in reply to Finding the lowest available UIDs

ronix,
You could use the solution I provided in your last post to put all the entries in an array. Then sort the array in ascending order by the UID and you can slice and dice it any which way you want. Since you are now asking a more specific question then your previous post and what you mentioned in the CB, try this instead
#!/usr/bin/perl use strict; use warnings; my %used; while (my @entry = getpwent) { my $uid = $entry[2]; next if $uid < 200 || $uid > 250; $used{$uid} = 1; } for (200 .. 250) { next if $used{$_}; print "$_ is free\n"; }
s/warning/warnings/ thanks to Your Mother in /msg

Cheers - L~R