Check this link: http://api.metacpan.org/source/BOFTX/Games-Dukedom-v0.1.1/lib/Games/Dukedom.pm
You will see where I use MooX::Struct and later initialize an attribute with StructName->new; in several places.
You can specify a zero-element array with my @array = ();. However, I seem to recall that if you do not provide a value for an attribute in MooX::Struct the element is not created and is in fact undef. But you are using the accessor in your push statement so that shouldn't be a problem.
If I get a break from the kids tonight I'll run your code and see what I can find. (No promises on Halloween, though.)
Update: The actual CPAN docs (which include the module source and an executable) can be found here if you're interested: Games::Dukedom
In reply to Re^3: Novice problem: How to push a MooX Struct into a list?
by boftx
in thread Novice problem: How to push a MooX Struct into a list?
by dissident
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |