#!/usr/bin/perl use Cwd; use File::Find; use warnings; use strict; my $cwd = getcwd(); my %seen; find(sub { print "$_\n" if -d $File::Find::name && !$seen{$_}++; }, $cwd);