in reply to Re^3: WHAT IS WRONG TO PASS PARAMETER TO THE ARRAY?
in thread WHAT IS WRONG TO PASS PARAMETER TO THE ARRAY?
$VAR1 = { 'quantity' => 1, 'name' => 'abc1' }, { 'quantity' => 2, 'name' => 'abc2' }
$VAR1 = [ { 'quantity' => 1, 'name' => 'abc1' }, { 'quantity' => 2, 'name' => 'abc2' } ];
.............the rest of code has been omitted from heresub display_cart { my ($cgi, $session) = @_; # getting the cart's contents my $cart = $session->param("CART") || []; my $total_price = 0; my $RV = q~<table><tr><th>Title</th><th>Price</th></tr>~; if ( $cart ) { for my $product ( @{$cart} ) { $total_price += $product->{price}; $RV = qq~ <tr> <td>$product->{name}</td> <td>$product->{price}</td> </tr>~; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: WHAT IS WRONG TO PASS PARAMETER TO THE ARRAY?
by ig (Vicar) on Aug 06, 2009 at 11:53 UTC | |
|
Re^5: WHAT IS WRONG TO PASS PARAMETER TO THE ARRAY?
by Anonymous Monk on Aug 06, 2009 at 10:36 UTC | |
|
Re^5: WHAT IS WRONG TO PASS PARAMETER TO THE ARRAY?
by Anonymous Monk on Aug 06, 2009 at 10:49 UTC | |
by Anonymous Monk on Aug 06, 2009 at 10:51 UTC |