Hmmm, This did not work. my $count = keys %results_hash; gives me 0 And perl also complained that $results_hash had to be explicitly defined, so I had my $results_hash AND my %results_hash. This is not working. my hash is empty.
Radhika On Mon, 27 Oct 2003 21:24:28 -0600 Daniel Staal <[EMAIL PROTECTED]> wrote: > --On Monday, October 27, 2003 21:22 -0600 Daniel Staal > <[EMAIL PROTECTED]> wrote: > > > > > my $results_hash; > > Sorry, correction. That should be: > > my %results_hash; > > > while (my $res = $sth->fetchrow_hashref()) { > > push(@menu_id, $res->{"menu_item_number"}); > > push(@menu_desc, $res->{"description"}); > > $results_hash = ($res->{"menu_item_number"}, > > $res->{"description"}); > > } > > > > Then the hash won't expire at the end of the loop. > > Daniel T. Staal > > --------------------------------------------------------------- > This email copyright the author. Unless otherwise noted, you > are expressly allowed to retransmit, quote, or otherwise use > the contents for non-commercial purposes. This copyright will > expire 5 years after the author's death, or in 30 years, > whichever is longer, unless such a period is in excess of > local copyright law. > --------------------------------------------------------------- > > -- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]