Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
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 the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (4)
As of 2016-10-01 05:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Extraterrestrials haven't visited the Earth yet because:







    Results (574 votes). Check out past polls.