in reply to hash of arrays -- Im missing something
or just fill the hash in an other way:$player_info{$ipaddr} = [$nickname, $userid, $player_req]; for $key ( keys $player_info) { print @{$player_info{$key}} }
Remember you have a reference as a hash value, so you must deref it with adding a ${...}[index] or a @{...} to get access to the values of the array inside your hash.push @{$player_info{$ipaddr}} , ($nickname,$userid,$player_req); print ${$player_info{$ipaddr}}[0]; ## gives the nickname ...
update woahh Zaxo is right here with the qw-part, changed this.
----------------------------------- --the good, the bad and the physi-- -----------------------------------
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: hash of arrays -- Im missing something
by snafu (Chaplain) on Jul 26, 2001 at 07:24 UTC |