in reply to Moose: problem with accessor
I'm guessing you don't want to the mode to be changed except by methods of the class. If so, make a "private" writer.
has mode => ( reader => 'mode', writer => '_set_mode', isa => 'Str', required => 1, ); sub creaLog { my $self = shift; $self->_set_mode('changed'); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Moose: problem with accessor
by saintex (Scribe) on Mar 31, 2011 at 19:32 UTC | |
by ikegami (Patriarch) on Mar 31, 2011 at 19:43 UTC | |
by saintex (Scribe) on Apr 01, 2011 at 07:38 UTC | |
by ikegami (Patriarch) on Apr 01, 2011 at 13:45 UTC | |
by saintex (Scribe) on Apr 01, 2011 at 14:08 UTC | |
|