Perl is a server-side language. JavaScript is a client-side language. For a tree widget you need JavaScript. Google, and ye shall find many readymade solutions. Wrt Perl, all you can do is use Perl to create the JavaScript. But why do that if it already exists? Well, you might want to pull info from a database to create a dynamic tree that is, then, controlled by JavaScript in the user's browser. That would be a good integration of server-side Perl and client-side JavaScript.