What reasons are there to prefer glob over readdir (or vice-versa) in Perl?

前端 未结 10 745
野性不改
野性不改 2020-12-01 02:25

This question is a spin-off from this one. Some history: when I first learned Perl, I pretty much always used glob rather than opendir + read

10条回答
  •  盖世英雄少女心
    2020-12-01 03:05

    On a similar note, File::Slurp has a function called read_dir.

    Since I use File::Slurp's other functions a lot in my scripts, read_dir has also become a habit.

    It also has following options: err_mode, prefix, and keep_dot_dot.

提交回复
热议问题