in reply to Bad Practice

You created it? It looks to me like you lifted it out of Steve Brenner's old cgi-lib.pl. Heck, it even appears to me that Steve Brenner got one bug fixed which you guys didn't: he used
@in = split(/[&;]/,$in);
while you still use
@in=split(/&/,$in);
Modern browsers may use ";" as separators as an alternative to "&", so you need to fix that.

As for using it... see any discussion on hanging on to cgi-lib.pl.

Replies are listed 'Best First'.
Re: Re: Bad Practice
by mkirank (Chaplain) on Feb 27, 2003 at 10:29 UTC
    *Read Carefully* ...i never said we created it ...that is how we are shown to do it and we have been using it ...
Re: Re: Bad Practice
by gmpassos (Priest) on Feb 27, 2003 at 17:16 UTC
    Use of ";" as separator?! I never saw that!

    I have some modules that parse the incoming data for GET and POST urlencoded. They use only "&".

    Can you send some browser name that use ";"? Or any doc that tell that ";" can be used?

    I need to see if the modules need some update. ;-P

    Update: I saw in CGI.pm inside sub parse_params:
        my(@pairs) = split(/[&;]/,$tosplit);

    Graciliano M. P.
    "The creativity is the expression of the liberty".

      At least it's mettioned in the text of RFC-1866, section 8.2.1. See the bottom of that paragraph.
        Thanks! Is better to see the oficial doc. ;-P

        Graciliano M. P.
        "The creativity is the expression of the liberty".

        just being pedantic but since you have included the link to rfc1866 I have a question, given:

        "...The form field names and values are escaped: space characters are replaced by `+', and then reserved characters are escaped as per URL;..."

        how is it that a '+' can be recovered from an encoded value?

      I don't recall where, but I have seen ";"s used in a URL before. I think it was related to separating session keys from the rest of the query. It's not part of the normal query string format, but I have seen it used in some instances.

      -Alex