in reply to How to print unique directores
Not sure if you want unique directory names or directory paths, but either way just take a lesson from perldoc perlfaq4 - How can I get the unique keys from two hashes.
#!/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);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to print unique directores
by Anonymous Monk on Mar 17, 2011 at 07:06 UTC |