in reply to Reading specific files from a directory

File glob'it, and watch newbies cower in AWE!

my @dirc = <*>;
foreach $dir (@dirc) {
   print "$dir\n";
   print "  -- Found $dir\n"
      if $dir =~ /example(\d*?)\.txt/;
}

Only one line shorter, but I do think is more efficient.
  • Comment on Re: Reading specific files from a directory