I don't know that Perl is the (best) way to do this, but it can be done in Perl I'm sure... Howevever..
. 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.)