Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I've got version 1.00 of HTML::Form. I need to get values of inputs with the same name. Unfortunately and to my surprise, HTML::Form cannot handle this. The newest version can, but not version 1.00. Since I can't update the module, I am stuck looking for other solutions. How would I do this with HTML::Parser? The docs left me confused. Thanks.

Replies are listed 'Best First'.
Re: Problems with HTML::Form 1.00
by Anonymous Monk on Jan 20, 2004 at 21:48 UTC
    Since I can't update the module, I am stuck looking for other solutions.
    Install the module if you can't update it.

    How would I do this with HTML::Parser? The docs left me confused. Thanks.
    Confused how? HTML::Form does it, so just copy that.
      Install the module if you can't update it.

      Um, same thing.

      Confused how? HTML::Form does it, so just copy that.

      HTML::Form 1.00 does NOT do this.

        Um, same thing.
        No its not.
        Confused how? HTML::Form does it, so just copy that.
        Yes it does. HTML::Form uses HTML::TokeParser. HTML::TokeParser uses HTML::Parser. Therefore HTML::Form uses HTML::Parser.

        You still don't explain how you're confused.

Re: Problems with HTML::Form 1.00
by Anonymous Monk on Jan 21, 2004 at 16:32 UTC
    So I tried a regex. I know I should stick with a module, but I can't figure out HTML::Parser, so this is what I tried:

    (@values)= $html =~ /\"Assignment\" value=\"(.*?)\".*?File to submit/i +smg;

    The problem is that there is more than one input tag with the same name AND I am only interested in getting those input tags before the text: "File to submit". My regex doesn't work because it only captures the first input tag, since the .* syntax grabs everything up til "File to submit". Okay so I tried the range operator and a few other things and still couldn't get it to work. Right know I have just 2 input tags before that text ("File to submit"), but there could be more depending on the situation. How could I grab the values of those input tags?? Thanks, Monks.

Re: Problems with HTML::Form 1.00
by Anonymous Monk on Jan 21, 2004 at 19:28 UTC
    HELP! please . . . anyone out there???