Yikes! Looks like I need to back off, do some reading, and rework my database first. Then the rest should be come easy...not the Rube Goldberg I have here. And yes, I really do use Data::Dumper :-) As always, monks, thanks all for the help.
—Brad "A little yeast leavens the whole dough."
Comment on Re: AoH refs for setting HTML::Template loops
Spent a few hours reading, and ended up combining some of jeffa's node and some of dragonchild's, all with much consideration of gmax's educational nodes on database programming.
Here's the much reduced, working version:
my $stmt = "SELECT xm_branches.id AS value, xm_branches.name AS branch
+
FROM xm_users, xm_branches, xm_userbranches
WHERE xm_users.username = '$user'
AND xm_userbranches.user_id = xm_users.id
AND xm_userbranches.branch_id = xm_branches.id";
&execute_it($stmt);
$template = HTML::Template -> new(filename => "../xm_dialogs/editmenu.
+tmpl");
$template->param( branches => $sth->fetchall_arrayref({}));
Lessons learned: normalize that database and let the it do the work (also some unseen DBI stuff from gmax). Still need to work on INNER JOINs. Thanks all.