use strict; use warnings; use autodie; use Data::Dump; my $dir = ...; opendir(my $dh, $dir); my @f = grep { -f } readdir($dh); closedir $dh; dd \@f;