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

Mike Heins mikeh@minivend.com
Fri, 23 Feb 2001 13:14:26 -0500

Quoting Annie Flippo (aflippo@lunamedium.com):
> My example is:
> <html>
> Going into perl.<br>
> [perl tables=product_cat interpolate=1]
>     my $db = $Db{product_cat};

      if(! $db) {
	  Log("product_cat database doesn't exist!");

You aren't even getting the DB set. The error "can't call method on undefined
value" says that the $db is not set. Obviously something is missing....like
a Database product_cat .. something or other.

Once that is done, I think you have to do:

	my $set = $db->query(....);

The query method returns an array reference, not an array.

Then it should work.

Red Hat, Inc., 131 Willow Lane, Floor 2, Oxford, OH  45056
phone +1.513.523.7621 fax 7501 <mheins@redhat.com>

Any man who is under 30, and is not liberal, has not heart; and any man
who is over 30, and is not a conservative, has not brains.
 -- Winston Churchill