[ic] Getting at [item-list] "special tags" with perl

Brian Kaney brian at vermonster.com
Wed Nov 10 15:36:35 EST 2004


On Wed, 2004-11-10 at 14:56, Grant wrote:
> > 
> > Can I get at special tags like [quantity-name] and [item-price] when
> > manually looping around perl blocks?  Or does "interpreted only inside
> > their corresponding list container" mean I can't get at them directly?
> > 
> 
> Try using [calc][item-price][/calc] instead of the perl tag or [perl
> interpolate="1"][item-price][/perl].

Okay, tried I tried:

[perl interpolate="1"]
my $ret;
foreach my $item (@{$Items})
{
   $ret .= "Quantity for ".$item->{'code'};
   $ret .= "is ".[quantity-name]."<br/>\n";
}
return $ret;
[/perl]

And got this:

Quantity for 100100 is ARRAY(0x9b605a0)
Quantity for 100008 is ARRAY(0x9b605dc)
Quantity for 100011 is ARRAY(0x9b605dc)
Quantity for 100033 is ARRAY(0x9b605dc)

I looked at the resulting arrays->[0] and found a single value '0' for
each, anything else (i.e. [1] or [2]) were undefined.  

Same result if I try [item-price] or [item-quantity] or any other
special tag.

- Brian






More information about the interchange-users mailing list