Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Determine largest key in hash

by MidLifeXis (Prior)
on Oct 04, 2011 at 17:39 UTC ( #929610=note: print w/ replies, xml ) Need Help??


in reply to Determine largest key in hash

Is there a reason to use a hash instead of an array for the first layer (update: or even the dynamic data)?

@data = ( { # Not quite certain what purpose this serves # 1 => "", #dynamically created # Perhaps something like this instead... dynamic_data => [ ... ], name => "", that => "", }, # ... and so on );

Then, your code would instead be ...

push @{ $data[0]{dynamic_data} }, "blah"; push @{ $data[0]{dynamic_data} }, "bleh";

I would rename dynamic_data to something more descriptive, of course.

Perhaps a description or example of how you use the data or what it represents might help shake out an appropriate data structure.

--MidLifeXis


Comment on Re: Determine largest key in hash
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (5)
As of 2014-07-29 01:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (211 votes), past polls