Take a look at
DBIx::Copy. You pass it two database handles and tell it which tables you want to copy. It doesn't have facilities for recreating table structure, though, so you'll need to use DB-specific commands (either from command-line tools or DBI) to create the tables first.