I have two distinct questions concerning TMPL_LOOP substitution. I hope you 
can help me with either or both. 

First off, in reading the documentation, it appeared to me that I could use 
an array of references to hashes to fill in a TMPL_LOOP. I'd simply create 
my array, then call $template->param(LOOP_NAME => \@array). However, this is 
not working properly for me; I'm wondering if it's because of how I'm 
constructing my array. 

Basically, I'm using DBI's fetchrow_hashref() method to return a reference 
to a hash, and then plunking that into an array. Thus, I can call
$array[x]->{keyname} and get a value, no problem. Would I be able to 
properly use this with TMPL_LOOP, or do I need an array of hashes, not 
references to hashes? 

Alternately, I've thought this problem could be due to me not using all of 
the keys in the hash as TMPL_VARs. Would this cause a problem? 

Second, I have several TMPL_LOOPs which are named "Q1", "Q2", etc., each of 
which contain the same TMPL_NAME variables. I'd like to be able to just loop 
through them and perform param()s on them; I figured I could simply build a 
string with the name of the TMPL_LOOP, and then pass it to param(), like so: 

for ($x=0; $x<5; $x++)
  {
  $base = "Q";
  $name = $base.$x;
  $template->param($name, \@array);
  } 

Even when I manually make a string that matches the name of a TMPL_LOOP, 
though, it fails to function; it fills in "SCALAR<memory address>". Is it 
possible to do what I'm thinking of? If so, how? 

Thanks,
Alex Kirk

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to