my $p = './a'; my @paths = (); find( sub { return unless -d; print "$File::Find::name in $File::Find::dir\n"; unless( $p eq $File::Find::dir ){ print "CH\n"; push @paths => $p; } $p = $File::Find::name; } , $p ); push @paths , $p; print "--> $_\n" for @paths; # this has been tested #### find( sub { next unless -d; mkdir File::Spec->catpath( ... ) } , ' ... ' );