[interchange-docs] xmldocs - racke modified glossary/price

Stefan Hornburg (Racke) racke at linuxia.de
Mon Dec 10 15:11:50 EST 2007


Kevin Walsh wrote:
>> +UserTag calc_price Routine <<EOR
>> +sub {
>> +	my ($code, $quantity, $set);
>> +
>> +	$code = $Vend::Interpolate::item->{code};
>> +	$quantity = $Vend::Interpolate::item->{quantity};
>> +
>> +	$Tag->perl({tables => 'vendors_pricing'});
>> +
>> +	$set = $Db{vendors_pricing}->query(q{select price from vendors_pricing where sku = '%s' order by price asc limit 1}, $code);
>> +
>> +	if (@$set) {
>> +		return $set->[0]->[0];
>> +	} else {
>> +		return 0;
>> +	}
>> +}
>> +EOR
>>
> Is there any particular reason why you're using $Vend::Interpolate::item
> instead of just $item in your example code?  I find it more readable to
> just use $item.
> 

Historic legacy or sheer ignorance, you name it. Fixed.

Thanks, Kevin

	Racke

-- 
LinuXia Systems => http://www.linuxia.de/
Expert Interchange Consulting and System Administration
ICDEVGROUP => http://www.icdevgroup.org/
Interchange Development Team



More information about the docs mailing list