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

Re^2: need help in creating multi dimensional array

by misterb101 (Sexton)
on Feb 10, 2006 at 14:51 UTC ( [id://529367]=note: print w/replies, xml ) Need Help??


in reply to Re: need help in creating multi dimensional array
in thread need help in creating multi dimensional array

yep, so if the indices in your arrays are arbitrary or if your multidimensional array is sparse (like a sparse matrix) you'd better use hashes of hashes.
for instance if you declare $a->[10000] = 1 it also autovivivies elements 0 until 9999 setting the value to undef. This takes up unnessessary (? difficult word;) space, and makes loops much more cumputation intensive.

Cheers,
Rob

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (3)
As of 2024-07-22 11:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.