#!/usr/bin/perl -W my $alluids = "/tmp/uid_list.file"; open (UIDS, ">$alluids") || die "Cannot open file $alluids\n"; while (my @uidlst = getpwent) { print UIDS "$uidlst[2]\n"; } close(UIDS); open (UIDS, "<$alluids") || die "Cannot open file $alluids\n"; while() { chomp; push(@arr, $_); } close(UIDS); my %hash = map { $_ => 1 } @arr; foreach $i (200..250) { if ( ! defined $hash{$i} ) { print "$i "; } }