in reply to Re: How to allocate a struct?
in thread How to allocate a struct?
First, I want to thank you all for welcoming me!
I didn't expect to get an answer so quickly when I noticed Loops posted the first answer. I did some experiments with the code Loops corrected for me, mainly trying to replace the constants in the example with variables, as the final content of the struct members are not yet known when the struct is created. But I then ran into new problems trying this... Then I noticed two more replies arrived.
I think perlron's suggestion to thoroughly read perlreftut, perldata, perldsc and perlvar docs could indeed be the key. By the way, I read the class::struct doc several times, but it leaves open a lot of questions. Maybe the docs mentioned will reveal much insight... At least it could help avoiding things like misunderstanding of strings being arrays Athanasius pointed at...
I'll also look into Moo instead of class::struct, as suggested by Loops and Athanasius.
Thank you again! Now I'll have to read a lot more documentation and do more experimenting...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: How to allocate a struct?
by perlron (Pilgrim) on Oct 28, 2014 at 14:36 UTC | |
by dissident (Beadle) on Oct 28, 2014 at 21:10 UTC | |
by BrowserUk (Patriarch) on Oct 28, 2014 at 21:20 UTC | |
by dissident (Beadle) on Oct 28, 2014 at 22:58 UTC | |
by BrowserUk (Patriarch) on Oct 28, 2014 at 23:30 UTC | |
by Anonymous Monk on Oct 29, 2014 at 13:36 UTC |