in reply to merging multiple name-value pairs (with precedence)

Addendum: Basically, I know i could split into an array on '&', and then split each element on '=' into hash keys/values, and do cookie, post, get (so newer vals overwrite existing vals), but is there a better way?
yep! :) See the "MIXING POST AND URL PARAMETERS" section of the CGI docs .. It says that param() will always return the POST'd data, and that you can simply use url_param() for the GET data .. So you can just do cookie, param, url_param ..

Replies are listed 'Best First'.
Re^2: merging multiple name-value pairs (with precedence)
by EvanK (Chaplain) on Feb 09, 2006 at 15:02 UTC
    well, i'm getting this data in a roundabout way, so CGI may not be able to see it as "POST" data or "GET" data, it will just see it as two name-value strings. so i sort of need to process all this data as just three seperate strings.

    (i'm working within the limitations of an existing system, unfortunately)

    __________
    Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life.
    - Terry Pratchett