To clarify: you will write JavaScript code in your page which makes an asynchronous request to the back-end (Perl) server as the user does various things. It is often the case that the back-end will format a chunk of HTML (using some kind of template system) and then send back that HTML as part of a (JSON-encoded) response. This HTML is then inserted into the "innerHTML" of something on the screen. There is actually a tremendous amount of material out there on so-called "AJAX," for every programming language under the sun. "w3schools" even has on-line "try it!" demonstrations. Once you get the hang of what it is you are needing to do, "doing it in Perl" is straightforward.