Hello Dave,
here's your bug:
> while (($game_id, @teams) = each %fixture) {
> print "Game=$game_id Home=$teams[0]\n";
> }
I guess you thought that @teams would get an arry of
values. Instead, the array is assigned one array reference.
To access the array elements from a referenc
EMAIL PROTECTED]
Sent: Thursday, September 22, 2005 10:28 PM
To: beginners@perl.org
Subject: Retrieving Values from a HOA
Hello perlfolk.
Goal: Create a hash of arrays where
hash key = match number
array[0] = home team
array[1] = away team
and then retrieve the teams by
Hello perlfolk.
Goal: Create a hash of arrays where
hash key = match number
array[0] = home team
array[1] = away team
and then retrieve the teams by retrieving all the keys
while ( @fixture_rec = $sth->fetchrow_array ) {
my $game_id = $fixture_rec[0];
p