use File::Find; my @dirs; find( sub { -d and push @dirs, $File::Find::name }, @ARGV ); print $_,$/ for @dirs;