in reply to www::mechanize matchup.io form and clicking

Welcome to the monastery, rocteur.

they give me all sorts of errors whatever I try

If you perform an action which results in an error and seek some help to avoid producing the error it is usually a good idea to tell the potential helpers what the exact error message was and what the exact code was which you executed to cause it. Without that information the potential helpers could spend a lifetime guessing and guessing and guessing what the underlying problem might be.

Are you familiar with the SSCCE concept? If you can provide one of those the monks will be more inclined to help you in your quest.

  • Comment on Re: www::mechanize matchup.io form and clicking

Replies are listed 'Best First'.
Re^2: www::mechanize matchup.io form and clicking
by Anonymous Monk on Apr 19, 2015 at 11:18 UTC
    The point I was trying to make is that the form items that need to be posted contain square brackets
    user[email]= (email) user[password]= (password)
    I imagined people in this group who know www::mechanize would see the issue help me understand how to pass this to the from as the obvious way to me does not work

    As I said I'm only just learning www::mechanize and whilst searching for help I saw people write that members of this site know www;:mechznize..

    $agent->submit_form( form_number => 1, fields => { user[email] => $login, user[password] => $passwor +d }, );
    syntax error at ./mechaM.pl line 20, near "user[" Execution of ./mechaM.pl aborted due to compilation errors.
      I'm not sure it solves your problem, but to create a hash with the keys specified in Perl, you have to quote the keys, as they aren't simple barewords:
      fields => { 'user[email]' => $login, 'user[password]' => $pas +sword },

      See perlop for details:

      The => operator is a synonym for the comma except that it causes a word on its left to be interpreted as a string if it begins with a letter or underscore and is composed only of letters, digits and underscores.
      لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ
      If this is "the point that you are trying to make," then be sure to make that clearly. Emphasize it. When your question is clear and direct, an answer follows quickly. If not, confusion and requests for clarification.