in reply to delete all directories which are not in list

Minimal example code to accomplish the task you described:
#!/usr/bin/perl use strict; use warnings; my %have; chomp, $have{$_}++ while <>; rmdir or warn "Can't remove `$': $!\n" for grep /^t\d+$/ && !$have{$_} && -d, <*>; __END__
Note: this assumes that
  1. you will be running it in the directory in which the directories are to be found with 'list.name' as a cmd line argument,
  2. 'list.name' contains one entry per line,
  3. the directories are empty.
Of course it's up to you make any necessary modification in case not all of these conditions are satisfied.