Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
use JSON; open FH, "< myfile.json" or die $!; my $contents = <FH>; close FH; my $results = decode_json($contents);
My problem is that I wish to include the defining of the $results value in the class constructor, or possibly as a class method.Unfortunately I can't work out how to do this within Moose.
Can anyone help me?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Moose constructor help
by kennethk (Abbot) on Mar 13, 2014 at 15:23 UTC | |
by greengaroo (Hermit) on Mar 14, 2014 at 18:34 UTC | |
|
Re: Moose constructor help
by Anonymous Monk on Mar 14, 2014 at 02:40 UTC |