There are actually several ways of doing this. You should look for documentation on
glob for one:
do_something($_) foreach (<*.swf>);
You can use
opendir,
readdir, and
closedir and use a regexp or other file-test operation against each file found to determine if it matches your criteria:
opendir FOO, $dir or die $@;
foreach (readdir FOO) {
do_something($_) if /\.swf$/;
}
closedir FOO;
Or, if you need to recurse into subdirectories, you should consider
File::Find. I'll let the documentation at CPAN illuminate that one for you.