+my %dirs;
+@dirs{@dirs} = ();
+
+my $files = join '', map { " - $_\n" }
+ grep {
+ my $d = $_;
+ while(($d = dirname($d)) ne "."){
+ last if exists $dirs{$d};
+ }
+
+ # if $d is "." it means we tried every parent dir of the file and none
+ # of them were in the private list
+
+ $d eq ".";
+ }
+ sort { lc $a cmp lc $b } @files;
+