I meanwhile read a lot of perldoc pages and in the perlmonks site. If it were not for the hassle to have to set up a .pm module for each different struct I'd like to use, I'd use the way described in perltoot. But what I want is just basic structs like in old C, without additional OOP features and the like I don't need for my project.

I feel the lack of structs is really a problem, as there are countless implementations of struct simulations. Mouse, Moose, and all their forks. I really do not understand why the Perl gods don't add structs to Perl itself to make things easier and cleaner.

So I finally decided to go the way Athanasius suggested in his update. This example of MooX really looks natural and straightforward, compared to the awkwardiness of the examples shown in the docs of the other packages like Moose and so on. But I ran to another problem, on which I probably better post a new question.

Thanks again to all of you!


In reply to Re^4: How to allocate a struct? by dissident
in thread How to allocate a struct? by dissident

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.