in reply to Re^2: Novice problem: How to push a MooX Struct into a list?
in thread Novice problem: How to push a MooX Struct into a list?
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
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: Novice problem: How to push a MooX Struct into a list?
by dissident (Sexton) on Oct 31, 2014 at 23:29 UTC | |
by Loops (Curate) on Nov 01, 2014 at 00:06 UTC | |
by boftx (Deacon) on Oct 31, 2014 at 23:43 UTC | |
by dissident (Sexton) on Nov 01, 2014 at 01:41 UTC | |
by boftx (Deacon) on Nov 01, 2014 at 01:46 UTC |