[ic] Filling perl hashes with [query] and searching the hash for product display restriction

Mike Heins mikeh@minivend.com
Thu, 25 Jan 2001 12:51:28 -0500

Quoting Jeff Carnahan (jcarnahan@networq.com):
> [item-list products="[scratch array]"] is necessary, where the "array"
> scratch variable is an array of product SKU's. Mike, I've often created a
> listing of products I want to display information about, and my client is
> more familiar with the [item-field blah] syntax of referencing data, yet I
> can't feed my product sku's into an [item-list]... What do you think?

How is this different from:

	[loop prefix=item list="[scratch array]"]


Also, as of 4.6.2 (CVS at this point), you can create an arbitrary array
in the form created by $db->query();

    # Here we can take the direct results of an op like
    [perl tables=products]
	    my $db = $Db{products};
	    @set = $db->query('select sku,price from products');
	    $Scratch->{ary} = \@set;

     Called with this (note the backticks)
    [loop list=`$Scratch->{ary}`] [loop-code] [loop-param price]

Suggested by Kaare Rasmussen.

Akopia, Inc., 131 Willow Lane, Floor 2, Oxford, OH  45056
phone +1.513.523.7621 fax 7501 <heins@akopia.com>

Nature, to be commanded, must be obeyed. -- Francis Bacon