in reply to Create a table in Mysql with perl

I think you really want to split this up into a sequence of 2 do method calls:

eval { $dbh->do(q{drop table if exists newtable}); }; $dbh->do(q{create table newtable select t.time, t.name, t.last, t.comp +any, t.wife from t join p on t.wife = p.wife and t.company = p.compan +y'}); $dbh->disconnect;

Although it is possible with some DBI::DBDs to batch up statements separated with ';' it is not portable and not guaranteed to work.

Of course, this is just advice and not necessarily the solution to the problem since you did not say what error you were getting doing it your way.