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

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

    That was a pretty comprehensive list. readdir (and readdir + grep) has less overhead than glob and so that is a plus for readdir if you need to analyze lots and lots of directories.

提交回复
热议问题