function, which expands filenames with wildcards.
. Also take a look at the
function and its documentation. You may be able to speed up your query, and the doc has a grep-like code sample at the bottom: two for one! :-) I believe more than a few versions of grep have already been coded in Perl (with varying complexity, of course), so take a look around the web to avoid reinventing the wheel.