Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

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.


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

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (7)
As of 2015-11-25 10:40 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (673 votes), past polls