in reply to if (-d$_) failes because of white space
You need some diagnostics, friend (and code tags...):
use strict; use warnings; use Data::Dumper::Simple; foreach my $d (@dir) { if (-d $d) { print $d, "is a directory.\n"; } else { warn "Not a directory:".Dumper(\$d); } }
Try that and let us see your output. FWIW, you should also take a moment and read How (Not) To Ask A Question to help you get better answers faster.
|
---|