Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
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'
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Finding total number of subdirectories and list them
by Zaxo (Archbishop) on Feb 15, 2005 at 05:51 UTC | |
|
Re: Finding total number of subdirectories and list them
by gopalr (Priest) on Feb 15, 2005 at 06:13 UTC | |
|
Re: Finding total number of subdirectories and list them
by atcroft (Abbot) on Feb 15, 2005 at 05:45 UTC |