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
- you will be running it in the directory in which the directories are to be found with 'list.name' as a cmd line argument,
- 'list.name' contains one entry per line,
- the directories are empty.
Of course it's up to you make any necessary modification in case not all of these conditions are satisfied.