[ic] Custom UserDefined Variable Help

C.B. Currier interchange-users@icdevgroup.org
Thu Sep 19 14:55:01 2002


Trying to Set up a custom variable with a Routine that will run through a
series of caluclations against a sql db. I am having syntax problems. Do I
do the code as:

	UserTag shipping_calc Routine <<EOR
	sub {
		my $freight=0;
		my $itmcount = 0;

		my $db = $Db{store};
		my $tdb = $db->{SKUShipZones};
		my $item=$Carts->{main};
		foreach ($item){
			$itmcount++;

			my $qry = $tdb->query('Select * from SKUShipZones where sku =
$item->{code};');
			foreach $row(@$qry){
				$freight = $freight + $row->{FREIGHT};
			}
		}
	return $freight;
	}
	EOR


How would this work better as I get little debugging data from the error
logs.

C.B. Currier
cbc@spinrx.com