You can use this code for finding the count of .txt files.
use strict; use warnings; use File::Find; my $dir="/home/Perl/monks"; my $total=0; sub test { ++$total if($File::Find::name =~ /\.txt$/); } find(\&test,$dir); print "Total:$total\n";
In reply to Re: Recursive count
by leslie
in thread Recursive count
by sandy1028
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |