open (LIST, "<$html_dir/$good_file"); my @paths = ; close LIST; chomp @paths; my $total = 0; for my $p (@paths) { my $count = qx/find "$p" -type d -name class | wc -l/; chomp $count; $total += $count; }