in reply to How do I create a C-like struct with dynamic fields in Perl?

I initially thought of doing so in C, but it seemed pretty impossible
I really doubt that proposition (This a common linked list problem in C).

Perl can implement trees ("structs" that point to other structs) - no problem. This is often implemented as a reference to an anonymous hash.

But often in Perl this is implemented as a simple "Array of Struct", which in Perl is often a AoH (array of hash references) and you get the appropriate result by sorting.

If you are looking for a "simple solution", I would suggest that you give some data and what the desired output would be.

  • Comment on Re: How do I create a C-like struct with dynamic fields in Perl?