Help for this page
use File::Find::Rule; ... maxdepth => 1, in => "/home/a" );
my $cnt = () = glob "/home/a/*.txt";
opendir( my $d, "/home/a" ) or die "ack: $!"; my $cnt = grep { -f and /\.txt$/ } readdir $d;