[Date Prev][Date Next][Thread Prev][Thread Next][Interchange by date
][Interchange by thread
]
[ic] perl syntax of shopping cart items
> > So, stripping down the above example, you can push all the SKU
> > values into one array using the following two lines of Perl code:
> >
> > my @out;
> > push(@out,$_->{code}) for (@{$Carts->{main}});
> >
> A little bit more appropriate is:
>
> @out = map {$_->{code}) @{$Carts->{main}};
>
I didn't think of that. :-)
--
_/ _/ _/_/_/_/ _/ _/ _/_/_/ _/ _/
_/_/_/ _/_/ _/ _/ _/ _/_/ _/ K e v i n W a l s h
_/ _/ _/ _/ _/ _/ _/ _/_/ kevin@cursor.biz
_/ _/ _/_/_/_/ _/ _/_/_/ _/ _/