in reply to Pushing into a hash of arrays
Hashes and arrays are different things in Perl. When you write $directory{"owner1"}{0} = ["DIR1", "DIR2", "DIR3"]; you are assigning a new arrayref to a hashref inside a hash. That is, %directory = ("owner1" => { "0" => [...] }); and $directory{"owner1"}{0}[0] eq "DIR1". (Note the curly-braces vs. square-brackets for hash/array access.) If you iterate over keys %{$directory{"owner1"}} then your keys will show up in an undefined order, not necessarily counting from 0 on up.
I think you may need a comma in the push syntax as well as telling Perl you want to access the key as an array. Also assuming that you don't want the numerically-indexed hash in the middle layer, that would be:
push @{ $directory{"owner1"} }, $value;That's how I always write it, anyway.
|
|---|