in reply to Problems with unblessed references and HTML::Template

I'm pretty sure that first line doesn't do what you want it to. it is currently returning a reference to the value that executesql() returns. you probably meant

$htmlparams{BROWSEDATA} = executesql($db, 'SELECT ...', 1);

how are you declaring $template? and what exactly do you do with it before line 130? because that line as you have it looks good.