use File::Find; use File::stat; my $dir = "path/to/directory"; find ( {' wanted' => sub { my $file = $File::Find::name; ($n, $p, $uig, $gid, $dq, $c, $fn, $d, $s) = getpwuid (stat($file)-> uid); if (-f && (/^[^.]/) ) { print $file.":".$n.":".$fn; } }, 'preprocess' => sub { @_ = map { $_->[0] } sort { $a->[1] cmp $b->[1] || $a->[2] <=> $b->[2] } map { m/(\d+)(\.[^.]+$)/ ? [$_, $2.$`,int($1)] : [$_, "", ""] } @_; @_ = grep (/^[^\.]/, @_) } } ,$dir);'