Well, what we produce with a slash in front of an array is actually iteration, however it returns arrayreferences instead of the actual content of the array[member].

<b>id:</b>  ARRAY(0x8294fe4)<br>
<b>First Name:</b>  ARRAY(0x8138418)<br>
<b>Last Name:</b>  ARRAY(0x8138430)<br>
<b>Address:</b>  ARRAY(0x8138448)<br>
<b>Phone Number:</b>  ARRAY(0x8138460)<br>
<b>E-Mail Address:</b>  ARRAY(0x8138478)<br>
<b>Code:</B>  ARRAY(0x8138490)<br>
<b>Function:</B>  ARRAY(0x81384a8)<br>
<b>Confirmed:</B>  ARRAY(0x81384c0)<br>
<hr><br>

As for using an array, it provided a way to have code somewhere else to massage everything returned from the $sth->fetch. Providing TT with the actual $col_bind handle results in the original behavior of only displaying the first (or last) record returned.

@id has 247 items.

I intend to iterate over an array (or other such structure) and using a FOREACH loop in the template to accomplish this. That seems to be The Right Thing to do, although I admit I'm new to TT and don't quite understand why it wouldn't attempt to iterate over an array passed in as a variable.

Thanks,
Josh

Randal L. Schwartz wrote:
"Joshua" == Joshua Knarr <[EMAIL PROTECTED]> writes:


Joshua>      my $params = {
Joshua>          'id' => @id,

This code would get a red flag from me.  I suspect you mean id => [EMAIL 
PROTECTED],
not id => @id.  But seeing as you have only one item in @id, it's even
more confusing to me why you'd be using an array.  How about explaining
what you intend before we can talk about how to get to that in TT?



_______________________________________________
templates mailing list
[email protected]
http://lists.template-toolkit.org/mailman/listinfo/templates

Reply via email to