Hi, I haven't posted here in a while since I've been away from perl for a few months. Regardless, straight to the problem:
I have a sub which gets some information from a database and returns it (multiple rows) as an array of associative arrays. I want to stuff this array into another associative array which will be written to the template page in a TMPL_LOOP block.

$htmlparams{BROWSEDATA} = \&executesql($db,"SELECT ...",1);
This code gets the array of database data and puts it in the associative array.

However when HTML::Template attempts to write the data to the page with the line of code $template->param(%htmlparams);, I get the following error message:

Uncaught exception from user code:
Can't call method "isa" on unblessed reference at C:/Perl/site/lib/HTML/Template.pm line 2364.
HTML::Template::param(undef, 'ID', 47, 'TITLE', 'sometitle', 'BROWSEDATA', 'SCALAR(0x321a8a8)') called at C:\Inetpub\CCProduction\cgi_bin\gallery\viewcomment.cgi line 130
I think that undef has something to do with the problem. Any ideas? Thanks.

In reply to Problems with unblessed references and HTML::Template by lpoht

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.