my $tables_like = 'test001'; my $tables = [$dbh->tables()]; my $test_table = nextuniq($tables_like,$tables); my $sth = $dbh->prepare("CREATE TABLE $test_table (". "RowID INTEGER(3) PRIMARY KEY,". "DrawingNo VARCHAR(6) NULL ,") or die $dbh->errstr; $sth->execute; # do something $dbh->do("DROP TABLE $test_table");