use strict; use warnings; use File::Find; my @file = (); find(sub { push(@file, $File::Find::dir); }, "dir"); print "$_\n" for(@file);