janjan has asked for the wisdom of the Perl Monks concerning the following question:
$self->_get_info_from_database, here, would be a method that reads in a particular table and stores information about the object in $self -- like $self->{'first_name'}{$id}, $self->{'last_name'}{$id}, and so on. That way, the database call only has to be made once per invocation of the program.sub first_name { my ($self, $id) = @_; unless (defined $self->{'first_name'}{$id} $self->_get_info_from_database; } return $self->{'first_name'}{$id}; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Point of AUTOLOAD in a database environment?
by robartes (Priest) on Nov 14, 2002 at 19:46 UTC | |
by hossman (Prior) on Nov 15, 2002 at 01:28 UTC | |
|
Re: Point of AUTOLOAD in a database environment?
by princepawn (Parson) on Nov 14, 2002 at 19:39 UTC |