Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re^3: Novice problem: How to push a MooX Struct into a list?

by Loops (Curate)
on Oct 31, 2014 at 22:31 UTC ( #1105758=note: print w/replies, xml ) Need Help??


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?

You could create with an empty array reference instead of undef:

my $dno = Dirnode[$curpath, []];

Replies are listed 'Best First'.
Re^4: Novice problem: How to push a MooX Struct into a list?
by boftx (Deacon) on Oct 31, 2014 at 22:43 UTC

    Good call, Loops. I was thinking of his question in literal terms when he asked about initializing an array and completely overlooked initializing the array ref in the struct.

    You must always remember that the primary goal is to drain the swamp even when you are hip-deep in alligators.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1105758]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (6)
As of 2022-05-16 10:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (62 votes). Check out past polls.

    Notices?