To expand upon olus' explaination, the data structures that you have there get processed by Perl server side to produce the HTML. Once that HTML is sent to the user, it is just plain text being rendered by their browser, and the only way to do anything dynamic is with something client-side like Javascript.
In addition to olus' solution, if you really want to do the processing grunt work in Perl and don't mind the slower user experience, you can write a relatively small amount of Javascript to re-query the server when a change is made.