Help for this page

Select Code to Download


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