I realize you specified Perl, but I suspect this is more of a job for javascript.
However, the following nodes (locating by Super Searching for "tree view"), may give you some hints or ideas:
HTH,
In reply to Re: Clickable Tree Menu using Perl
by planetscape
in thread Clickable Tree Menu using Perl
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |