in reply to Setting accessor with Object::Tiny
I generally just use the Perl core object system rather than pulling in other packages. For what Object::Tiny gives you, have you considered using the core fields pragma instead?
I have often used an internal _set method like: (disclaimer: this exact code not tested)
sub _set { my $self = shift; my ($key, $value); while (($key, $value) = splice @_, 0, 2) { $self->{$key} = $value +} }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Setting accessor with Object::Tiny
by AnomalousMonk (Archbishop) on Aug 12, 2019 at 05:03 UTC | |
by jcb (Parson) on Aug 12, 2019 at 05:10 UTC | |
by AnomalousMonk (Archbishop) on Aug 12, 2019 at 05:31 UTC | |
by jcb (Parson) on Aug 12, 2019 at 06:23 UTC |