in reply to WHAT IS WRONG TO PASS PARAMETER TO THE ARRAY?

It looks like line 5 sets @partofcookie to $incomingdata, which should contain the first parameter passed into this subroutine ($_[0]). Line 4 forces @partofcookie to (I assume) a known good value. Uncommenting line 5 overwrites this with the "real" value. If this breaks the script, I'd guess that the value of $incomingdata is bad (try dumping it out, just as a sanity check). If this is the case, the problem lies upstream, in whatever routine is calling this sub (it's passing in a bad parameter).

By the way - you're using values from a cookie in your shopping cart logic?! Some clever hacker is going to buy 1000 units for $0.01...

  • Comment on Re: WHAT IS WRONG TO PASS PARAMETER TO THE ARRAY?

Replies are listed 'Best First'.
Re^2: WHAT IS WRONG TO PASS PARAMETER TO THE ARRAY?
by Anonymous Monk on Aug 06, 2009 at 00:04 UTC
    ### By the way - you're using values from a cookie in your shopping cart logic?! Some clever hacker is going to buy 1000 units for $0.01... ??? #### thanks for the reminder. i will do some code for blocking abuse