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
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.