[Date Prev][Date Next][Thread Prev][Thread Next][Interchange by date
][Interchange by thread
]
[ic] Syntax Question on Using Cart in UserTags (Perl)
C.B. Currier [cbcurrier@spinrx.com] wrote:
>
> Trying to do a loop through a cart inorder to do some SQL lookups.
> Having a problem with the fact that I believe the cart is being passed in
> but for what ever reason I cannot reference the array properly.
> Any suggestions on the below mentioned code is greatly appreciated.
> BTW: I am not necessarily getting an error, just not log string being
> returned.
>
> C.B.
>
> Code:
>
> UserTag test_calc Routine <<EOF
> sub {
> my $itmcount = 0;
> my $itmlst = "";
> my $item = $Carts->{main};
> foreach (@$item){
> $itmcount++;
> $itmlst.= $item->{code};
> }
> return $itmlst;
> }
> EOF
>
Change this line:
my $item = $Carts->{main};
to this:
my $item = $::Carts->{main};
--
_/ _/ _/_/_/_/ _/ _/ _/_/_/ _/ _/
_/_/_/ _/_/ _/ _/ _/ _/_/ _/ K e v i n W a l s h
_/ _/ _/ _/ _/ _/ _/ _/_/ kevin@cursor.biz
_/ _/ _/_/_/_/ _/ _/_/_/ _/ _/