my @subDirList=`dir /ad /b \"$dir\"`; if ($#subDirList >= 0) { $hasSubs=1; } for (my $counter = 0; $counter <= $#subDirList; $counter++) { chomp $subDirList[$counter]; $hasSubs = 1; }