You could spend a lot of time figuring out all the pieces of JavaScript on the client side and Perl on the server side in order to work out how to use Ajax in your code. Thankfully, there's already a module on CPAN to take the pain out it: CGI::Ajax.