Just a general tip: there's a trade-off between passing a "pure perl" structure and using objects that are really C structs underneath (besides the general pros and cons about encapsulation of classes vs open structs etc):

If you're going to pass a couple of thousands of structs containing many properties in a list (or nested) and you only really want to query a few of those properties in your perl code, you may well spend much more time converting all the data than you really need, while if you use objects you generally convert the property from perl to C or vice versa each time you access it from perl (but you don't need to convert anything you're not actually accessing).

Using objects instead of complex nested hashes may also be more efficient when you're modifying the structures, since it's usually trivial to keep the C and perl side in sync when you're using objects, while otherwise you're have to inspect the complete structure each time you pass it from C to perl to C.


In reply to Re^3: Embedding Perl / C++ structure question by Joost
in thread Embedding Perl / C++ structure question by TheGeniuS

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.