Representing the data can be a bit tricky. But choosing the best "shape" for the data really depends on how you're using it. I'd suggest sketching out the code for the problem you're solving, and see what sorts of access methods you need. That will help you select a good representation of the data. You might want to review the perl data structures cookbook (perldoc perldsc) before and after sketching out your ideas, just to help you make associations.
As far as choosing inside a legal range, the rand function (perldoc -f rand) should get you going. You might want to print out the first page of perlfunc as a handy list of the various types of functions built into perl.
...roboticus
When your only tool is a hammer, all problems look like your thumb.
In reply to Re: How to represent complex data structure and manipulate it easily?
by roboticus
in thread How to represent complex data structure and manipulate it easily?
by Hanken
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |