Perl FAQ: "How can I process every file in a directory that matches a certain filename pattern?"
There are several ways to do this, but I normally use the glob function, because I can remember the syntax pretty easily.
Let's look at a couple of glob examples.
Using the glob operator
You can use the glob operator to get a list of all files in the current directory like this: