I don't know that Perl is the (best) way to do this, but it can be done in Perl I'm sure... Howevever..
If you are running MySQL 3.23.33 or higher, you may want to look at this site. This is arguably the better way to do database mirroring, and will likely be supported in the larger closed source database implementations. (You'll probably have to re-learn the replication aspect of Oracle/Informix/Sybase/etc.)
Since the above mentioned link is the way that mysql provides for such a thing, I would recommend setting up one-way replication like this. However, if there is something magical about the database needing to be updated at a set interval, you could always use mysqldump on the secure host, then rebuild the web host from the dump without needing to close either host down.