Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re^2: need help in creating multi dimensional array

by misterb101 (Sexton)
on Feb 10, 2006 at 14:51 UTC ( #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
Node Status?
node history
Node Type: note [id://529367]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2021-05-08 22:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Perl 7 will be out ...





    Results (99 votes). Check out past polls.

    Notices?