in reply to Perl Cgi mysql document management

In your case. I'd let a client download the current version, edit it, and upload it (via a web-interface?) to the server. There, the server can handle versioning, saving or overwrite the current and or old document.