Pathologically Eclectic Rubbish Lister | |
PerlMonks |
Re^3: Novice problem: How to push a MooX Struct into a list?by boftx (Deacon) |
on Oct 31, 2014 at 22:27 UTC ( [id://1105757]=note: print w/replies, xml ) | Need Help?? |
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
You must always remember that the primary goal is to drain the swamp even when you are hip-deep in alligators.
In Section
Seekers of Perl Wisdom
|
|