opendir( DIR, $targetdir ) || die $!; my @files = grep{ /\.sf$/ } readdir( DIR ); ## do interesting stuff with @files #### ## when passing something like *.pl, make sure ## to single quote it so that the shell doesn't ## automatically expand it: ## ## scrip.pl '/foo/bar/*.pl' ## my @entries = <$ARGV[0]>;