ZAmonk has asked for the wisdom of the Perl Monks concerning the following question:
package This::That; use Moose; has 'FOO' => (is => 'rw', lazy => 1, builder=> '_build_generic'); has 'BAR' => (is => 'rw', lazy => 1, builder=> '_build_generic'); with qw(SQLConnection); sub _build_generic { my $self = shift; #my $attribute_name = $self->meta->???? - is it possible to determi +ne 'FOO' or 'BAR' is being set here ??? #my $sth = $self->dbh->prepare('select $attribute_name from table wh +ere x=? and y=?'); #$sth->execute(1,2); return $sth->fetchrow_array; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Retrieving attribute name for use in generic Moose builder method
by stvn (Monsignor) on Jul 01, 2009 at 18:46 UTC |