in reply to Reading specific files from a directory
Then use @files_i_want as desired.opendir(DIR, $somedir) or die "can't open $somedir for read: $!\n"; @files_i_want = grep { /^example\d(?:\.\d)*\.txt$/ } readdir DIR; closedir(DIR) or die "error closing $somedir: $!\n";
|
|---|