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

前端 未结 10 708
野性不改
野性不改 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:18

    Well, you pretty much cover it. All that taken into account, I would tend to use glob when I'm throwing together a quick one-off script and its behavior is just what I want, and use opendir and readdir in ongoing production code or libraries where I can take my time and clearer, cleaner code is helpful.

提交回复
热议问题