in reply to Re^3: Make array from field of another array
in thread Make array from field of another array

This appears to work, thanx for your help.
#!/usr/bin/perl -w #<UnusedGrp.pl> Find unused Groups in /etc/group use strict; my $GROUPfile="/etc/group"; my $gfpid = open(GFILE, "<$GROUPfile") or die "$GROUPfile File Not Fou +nd: $!\n"; my $PASSWD="/etc/passwd"; my $pfpid = open(PFILE, "<$PASSWD") or die "$PASSWD File Not Found: $! +\n"; my @PWLINES = <PFILE>; my @GIDS = map { (split /:/)[3] } @PWLINES; while (my $line = <GFILE>) { my @GRP = split(/:/, $line); if (length($GRP[3]) < 2){ #print "$GRP[0]:$GRP[2] is zero length\n"; if ( ! (grep $_ eq $GRP[2], @GIDS)) { print "$GRP[0]:$GRP[2] is Empty & not referenced in /etc/passwd +\n"; } } }