I think you're letting yourself get distracted by all the nifty options that perl allows. If you're just learning about OOP in perl, you should keep things as simple as possible. Stick to using hashref based objects to begin with, which would imply that your aref should be just one field of data inside that object. If it seems helpful,
each of the hashrefs inside that array could also be objects of a different class. And while most likely you'll want to just have the usual "get_*" and "set_*" methods that work on that aref as a whole, if you like you can have some "fancy accessors" that do things like push a hash ref onto the array, or pop one off of it.
(Oh, and one more hint: ignore whatever you hear about "Inside-Out Objects" for a little while longer. There's still room for debate about what the right way is to implement those, and most OOP perl code you see will be hash based).
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.