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

    Only the first -> is necessary. I would write it as

    $server->{cmds}[$i]{status}

    But i concur with your point, in general its easier to understand the -> style, as it reduces the possible meanings of $$ in your code (it has multiple meanings which depend on what follows, sometimes quite far after). In fact some people even avoid using bare scalar dereferencing on simple scalars just to avoid having $$ in their code. So they write ${$scalar_ref} instead of $$scalar_ref. (Im not in this camp personally).

    ---
    $world=~s/war/peace/g