use Path::Class (); my $dir = Path::Class::Dir->new("D:/DOWNLOAD/DISTRBTN/I01/"); for my $file ( grep { not $_->is_dir } $dir->children ) { print $file, $/; }