lakshmananindia has asked for the wisdom of the Perl Monks concerning the following question:
my $tmpl = { _data => [ ], _file => 'Unknown', }; for my $key ( keys %$tmpl ) { no strict 'refs'; *{__PACKAGE__."::$key"} = sub { my $self = shift; $self->{$key} = $_[0] if @_; return $self->{$key}; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: What is the use of getter and setter
by ikegami (Patriarch) on Nov 19, 2008 at 09:21 UTC | |
|
Re: What is the use of getter and setter
by Anonymous Monk on Nov 19, 2008 at 09:17 UTC | |
|
Re: What is the use of getter and setter
by massa (Hermit) on Nov 19, 2008 at 10:11 UTC | |
by Anonymous Monk on Nov 19, 2008 at 14:39 UTC |