in reply to help with HTML::Form

HTML::Form is good for parsing the source of an HTML form, but not for dealing with the parameters passed to a submitted form. If you're trying to do the latter, use CGI.pm.

But if you're really wanting to do the former, then keep in mind that, typically, few if any form inputs have values to start with.

That being said, what you have above should work. But, two things:
1. Forms don't usually have names. If you have more than one form, you'll need to "know" it by something else.
2. In the inner loop, that $data variable will actually be a reference to an input object. You can use that as the key in a hash, but I'm not sure that's what you're looking for anyway. Perhaps you mean something like this:

for my $input ( $form->inputs ) { my $name = $input->name; my $value = $input->value; if ( defined $name && defined $value ) { $hash{ $name } = $value; } }
But if you could explain exactly what it is you're trying to accomplish, I might be able to show you better examples.

jdporter
...porque es dificil estar guapo y blanco.

Replies are listed 'Best First'.
Re: Re: help with HTML::Form
by gnangia (Scribe) on Nov 08, 2002 at 22:21 UTC
    Hi! I am using the HTML::Form to parse the form in order to collect information about the form (such as hidden parameters) and then do a POST/GET on the action with all the form parameters in place using LWP. My bigger picture of why I am doing all this, is to create a generic a web response time tool.
    If you have any better ideas/examples, I would appreciate it.