What are the advantages of the hash method?
Two that I can think of off the top of my head are that you can have sparse property sets (e.g. if one object has {foo=>1,bar=>2} and the other has {quz=>1,baz=>2}, whereas you'd need four array elements to cover that, a bit of a waste), and that textual serializations of the data would be self-documenting. But if neither of those are a concern to you, then at the moment I can't think of major disadvantages to using constants for the array indicies.
In reply to Re^3: Hash vs constant vs package vs other for data structure
by haukex
in thread Hash vs constant vs package vs other for data structure
by oldtechaa
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |