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

Here's, the thing, I have an INI file that looks like this:

Login
username=admin
password=12345

I am using Config::Abstract::Ini to read this section
like this:

my %Login = $ini_db->get_entry('Login');

where %Login is a hash that holds those sub keys and their
values.


Now, in the WWW::Mechanize module, I can use these (below)
functions to insert fields to the page, either by using
the hash (%field_values) method or using the @criteria.

$mech->set_fields( %field_values ); $mech->set_visible( @criteria );

Question is, if I can do it like this:

$mech->set_fields( %Login );

And it will send the pair key and it's value as defined
in the ini file (?)


Moreover, I know what is a hash and how it looks like,
whats a @criteria? how does it look like?


Thanks.

Replies are listed 'Best First'.
Re: Hashes and alike, need some basic help (i think) :)
by planetscape (Chancellor) on Nov 10, 2005 at 16:31 UTC

    I usually use one of the techniques described here when I need to know what a data structure actually looks like, and how to work with it. :-)

    HTH,

    planetscape
Re: Hashes and alike, need some basic help (i think) :)
by kwaping (Priest) on Nov 10, 2005 at 18:56 UTC
      Question is, if I can do it like this:

      $mech->set_fields( %Login );

      And it will send the pair key and it's value as defined in the ini file (?)

    Seems to me like that would work.
      right, it's working just fine.
      it seemed like i only had a problem with the ini file formating but i got over it by looking closely :)

      thanks you guys