while(<STDIN>) { my($line) = $_; chomp($line); if($line !~ /total/) { if ($line =~ /(\w {1}).{55}(.+)$/ and $1=="d") { $count=$count+1; print "\n $2"; } } } print "Total no of directories = $count";
Edit by tye: Add code tags, remove br tags
20050219 Edit by castaway: Changed title from 'Findind total no of subdirectories and list them'
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |