in reply to hash of arrays -- Im missing something
I see a couple of problems that use warnings; use strict; would expose right away. First,
should be$player_info{$ipaddr} = [ qw($nickname $userid $player_req) ]; # and... $player_info{$1} = [ qw($value1 $value2) ];
because qw() does not interpolate the value of variables.$player_info{$ipaddr} = [ $nickname, $userid, $player_req ]; # and... $player_info{$1} = [ $value1, $value2 ];
Second,
is incorrect, the second of the pair is a scalar arrayref:while ( (my $nkey, my @nvalue) = each %player_info ) { #stuff }
Sorry, I didn't follow what you were doing in that block.while ( (my $nkey, my $nvalue) = each %player_info ) { # stuff with $nvalue->[$ndx] }
After Compline,
Zaxo
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: hash of arrays -- Im missing something
by snafu (Chaplain) on Jul 26, 2001 at 07:22 UTC |