HI MONKS. GOOD EVENING.

I HAVE BEEN HEACHACHE FOR THIS PROBLEM FOR A MONTH.
COULD ANY ONE HERE HELP ME A BIT ABOUT it


When i uncomment line 5, it will retuan a blank page for me.
while it runs well if i comment on line 5


Why. since i need to get paratemter from $_[0], so i have to uncomment line 5, but it did not work for me. what happened?

by the way line 3 shows my $incomingdata = $_[0]; which is no problem at all as i has a testing print the string out as i expected .

so i suspect the problem is between line 4 or line 5. but i am unable to fix it up. could any one help me ? Many many many thankssssssssssssssssss


1 sub { # 2 my ($cgi, $session,$product,$tags,$itemID, $incomingdata); 3 my $incomingdata = $_[0]; ################# 4 my @partofcookie= ({name => 'abc1',quantity => 1},{name => 'abc2',q +uantity => 2}); 5 #my @partofcookie= ($incomingdata); 6 foreach my $product ( @partofcookie) { ##test 7 $product->{prod_subtotal} = $product->{price} * $product->{quantity} +; 8 $tags->{total_price} += $product->{prod_subtotal}; 9. $tags->{itemmaxtemp}=$itemmaxtemp; 10. $tags->{itemID}=$itemID; 11 push @{$tags->{cart_loop}}, $product; 12 } 13 my @xxx; 14 @xxx = @{$tags->{cart_loop}}; 15 return { orderdetail_loop => \@xxx}; 16 }

In reply to WHAT IS WRONG TO PASS PARAMETER TO THE ARRAY? by courierb

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.