"be consistent" | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Short AnswerYou can use references to store any concievable kind of data structure in perl.
Long Answer: what is your goal
Am I treading so close to OOP that I just need to take the plunge now?It depends on what you intend to do. Are you storing this data to keep an inventory database of merchandise? Are you creating a structured entity with properties (eg print $color{car}) and methods (eg $car->drive('50mph') )? Are you rolling your own format for an initialization file? Are you ever going to need more than one 'car' or 'bike'? Are you ever going to need nested data (eg a car with a bike in the trunk)? OOP may not even be relevant if you are simply looking for a way to store some text data. See what else is already out thereYou can always search on CPAN, you may find something that already fits the bill perfectly. Also, by examining someone else's approach to your goal, you will discover answers to question you hadn't even considered yet. All in all, it is a great way to learn new stuff. In reply to Re: When hashes aren't enough
by dimar
|
|