in reply to Recursive count

Hi sandy,

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";