Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I have variables like this for data
Now some of these vars will NOT be used and will be set to ="". A's are the field names, B's are the values.$var1_a = "name"; $var1_b = "Richard"; $var2_a = "age"; $var2_b = "12"; $var3_a = "location"; $var3_b = "mars";
Is there a better way to set this up? Preferably a way that the user can add INFINITE form fields for WWW::Mechanize to pull through?
Other question is a two parter. If using MY method of hard coding the vars, how do I transfer them to my $mech call the most efficient way? I don't suppose I can put if conditionals in the FIELDS() to see whether certain fields were used.
2nd question is, if you have a better way of storing the data and looping over the form fields/values, can you post an example?$mech->submit_form( form_name => $search_form, fields => { $forum_user => $username, $forum_pass => $password, } );
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: WWW::Mechanize with optional fields
by Joost (Canon) on Jun 24, 2006 at 10:44 UTC | |
|
Re: WWW::Mechanize with optional fields
by shmem (Chancellor) on Jun 24, 2006 at 10:43 UTC |