Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: MooseX::Storage JSON load not functioning as expected

by Loops (Curate)
on Jul 07, 2013 at 20:09 UTC ( #1043009=note: print w/ replies, xml ) Need Help??


in reply to MooseX::Storage JSON load not functioning as expected

The problem is that you've hard coded the creation of a new "batt" instrument in the BUILD method. The object is loaded properly from file1.json and then the BUILD method unceremoniously overwrites it with a newly constructed object with the default value


Comment on Re: MooseX::Storage JSON load not functioning as expected
Replies are listed 'Best First'.
Re^2: MooseX::Storage JSON load not functioning as expected
by irishBatman (Novice) on Jul 08, 2013 at 23:17 UTC
    Thanks, I have modified the code to check if the hash elements have been created yet and create them if not. This seems to work.

    I am wondering if there is a cleaner way of creating my object structure in the first place?

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (5)
As of 2015-07-08 02:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (93 votes), past polls