How can I list files under a directory with a specific name pattern using Perl?

后端 未结 6 875
长发绾君心
长发绾君心 2021-01-07 12:15

I have a directory /var/spool and inside that, directories named

a  b  c  d  e  f  g  h i  j  k  l  m  n  o  p q  r  s  t  u  v  x  y z

An

6条回答
  •  独厮守ぢ
    2021-01-07 13:09

    For a fixed level of directories, sometimes it's easier to use glob than File::Find:

    while (my $file = ) {
      print "Processing $file\n";
    }
    

提交回复
热议问题