use File::Find; find(\&dir_names, "/home/gube/"); sub dir_names { print "$File::Find::dir\n" if(-f $File::Find::dir,'/'); }