use File::Find; my @files; find( { wanted => sub { push @files, $File::Find::name if -M; } }, '/dir' );