Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

Re: Hash of a nArray and all that comes with it.

by moritz (Cardinal)
on Jul 28, 2012 at 05:43 UTC ( #984149=note: print w/replies, xml ) Need Help??

in reply to Hash of a nArray and all that comes with it.

%entry = {$item_id=>\@data, $item_id=>\@data.....etc}

I hope that's not what you're doing, because that assigns a hash reference to a hash without dereferencing.

As long as I give an explicit value for $j's range, the output is fine. But I cannot figure out how to access the arraysize for $entry[$i]
my $len = scalar @{ $entry{$key}[$i] }

gives you the length of the $i array stored at $key.

And I think you're missing the part of your code where you assign to @entry, I can't see how you'll get any output like this. @entry = @{ $entry{$key} } should fix it.

Replies are listed 'Best First'.
Re^2: Hash of a nArray and all that comes with it.
by kingram (Acolyte) on Jul 29, 2012 at 00:53 UTC
    This is how %entry is being populated in the foreach loop:
    @update = ($id, $title, $foo, $bar, $baz); $entry{$file_num} = \@update;

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://984149]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (13)
As of 2016-12-05 16:17 GMT
Find Nodes?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:

    Results (88 votes). Check out past polls.