Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

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.


Comment on Re: Hash of a nArray and all that comes with it.
Select or Download Code
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?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://984149]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (12)
As of 2014-07-23 11:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (140 votes), past polls