I am writing a script that searches for specific files in a directory and processes them. I continue to write the following:
opendir DIR, $dir;
@files = readdir DIR;
closedir DIR;
While I could (and really should) wrap this in a function, I was wondering if there is a more elegant way to do this?
source
share