use File::Find; use File::stat; use strict; use warnings; my $dir_search = "/home/u1"; #I'd rather do a cmd line arg my $min_uid = 1000; #but for this... my %hash; open PASSWD, '/etc/passwd' or die "Could not open /etc/passwd"; while (){ my ($user, $toss , $uid) = split(/:/); $hash{$uid} = $user if $uid > $min_uid; } close(PASSWD); my @uids = keys %hash; File:find (\&wanted, $dir_search); exit; sub wanted { return if (-d $_); #Let's just list files my $st = stat($_); next unless defined($st); #Diagnostics may be wanted here if (grep($st->uid, @uids)) { print $hash{$st->uid}, "\t", $File::Find::name, "\n" ; } } # on slices # Vynce suggested: my ($user, undef, $uid) = split(/:/); # jeffa this: my ($user,$uid) = (split(/:/))[0,2];