my @files = () ; opendir DIR, '/path/to/dir' ; foreach( readdir DIR ){ # do this unless it matches a digit or char followed by T # or V followed by anything. push @files, $_ unless/[\d\w][TV].*/ ; }