in reply to Moose constructor help
There are a lot of variations how that would look depending on what you actually intend to do. See Default and builder methods in Moose::Manual::Attributes for more details.use Moose; use JSON; has content => isa => 'Str', is => 'ro', required=> 1, ; has results => isa => 'Str', is => 'ro', default => sub { decode_json($_[0]->content) }, ;
#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Moose constructor help
by greengaroo (Hermit) on Mar 14, 2014 at 18:34 UTC |