The "scalar" he's putting in there is actually an array reference, which is
totally kosher. I've gotten this error many times, and it has always been as
a result of selecting data from a database into a variable (either a true
scalar or an arrayref) and the variable not containing any data when it gets
turned into a param. There would be several ways to fix it, including
setting $rows manually if it doesn't return valid data or some similar sort
of undefined value handling....or other, simpler ways which I can't remember
right offhand. I'll look through my code though and see how I handled it.
In the meantime, while I look for a better way of doing it, try putting this
line after the line at which you define $rows:
$rows = [ { status => 'null' } ] if !$rows;
In this example, the loop "ROWS" will have a tmpl_var called "status" which
will be set to 'null' if $rows evaluates as false. It's a bit of overkill,
but it'll fix your problem.
But seriously Doc, lighten up, and remember that we're trying to help you
out of the goodness of our hearts and our wish to support other developers
using HTML::Template.
Brian McCain
PageMasters Internet Group
----- Original Message -----
From: "Kenny Smith" <[EMAIL PROTECTED]>
[ snipped ]
| Check your data, it sounds like you are putting a scalar variable in the
| 'rows' variable, but you are tagging 'rows' as a TMPL_LOOP in your
template.
| You have to fix one or the other.
|
| Kenny Smith
| JournalScape.com
|
----- Original Message -----
From: "Doc" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Thursday, October 10, 2002 2:14 PM
Subject: Re: [htmltmpl] Error code.
Then H-T must be incrediable dumb since that tmpl_var ROWS is in it.
<TMPL_LOOP NAME=ROWS> and Script says ROWS too. I am very much aware of case
sensitive nature of linux.
----- Original Message -----
From: "Sam Tregar" <[EMAIL PROTECTED]>
To: "Doc" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Thursday, October 10, 2002 12:35 AM
Subject: Re: [htmltmpl] Error code.
> On Wed, 9 Oct 2002, Doc wrote:
>
> > HTML::Template::param() : attempt to set parameter 'rows' with a scalar
> > - parameter is not a TMPL_VAR! at dbview.pl line 22
>
> This means that HTML::Template didn't see:
>
> <tmpl_var name="row">
>
> in your template file. If you'd rather HTML::Template was quiet about
> this situation then set die_on_bad_params to 0 when you call new().
>
> -sam
>
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Html-template-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/html-template-users
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Html-template-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/html-template-users