in reply to Pseudo-hashes & Hashes
my @cmdarr = $$server{"cmds"}; # <-is this correct
No, because a value in a hash (anonymous or not) is a scalar - which can be an array reference, of course. So, judging from your data, the correct idiom would be
my @cmdarr = @{$server->{"cmds"}};
For me, it is much simpler to de-reference references with the -> notation, so I would write
$server->{"cmds"}->[$i]->{status}
instead of
$$server{"cmds"}[$i]{status}
What does your csv2hash function return? A list or a reference? Check that, it could be the cause of "Reference found where even-sized list expected ...".
--shmem
_($_=" "x(1<<5)."?\n".q·/)Oo. G°\ /
/\_¯/(q /
---------------------------- \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Pseudo-hashes & Hashes
by demerphq (Chancellor) on Mar 17, 2008 at 10:20 UTC |