Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Determine largest key in hash

by MidLifeXis (Monsignor)
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

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (10)
As of 2016-12-07 18:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (131 votes). Check out past polls.