mnlight has asked for the wisdom of the Perl Monks concerning the following question:
I then return the refs from the subroutine.my $rows = $sth->fetchall_arrayref();
I then pass it to another subroutine$options = get_options() <
Then I loop through the rows and try to build the hash with a countchange_dboption ( \$dbh, $DB, $date, $options );
I feel like I am reinventing the wheel by creating the hash but I want the user to be able to input an integer to represent the options returned from the database. So the value they supply will be used to call up the value from the hash.my $count = 1; my %option_ref = (); foreach $option ($options){ %option_ref = {$count => @$option}; $count++; }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: bulding a hash
by ikegami (Patriarch) on Jul 19, 2007 at 16:57 UTC | |
Re: bulding a hash
by philcrow (Priest) on Jul 19, 2007 at 16:59 UTC | |
by mnlight (Scribe) on Jul 19, 2007 at 18:42 UTC |