package Friender::Search::Search; use strict; use SQL::Abstract; sub new { my $class = shift; my $self = {}; bless($self, $class); $self->init(@_); return $self; } sub init { my $self = shift; my ($dbh, $st, @bind) = @_; my $sth = $dbh->prepare($st); $sth->execute(@bind) or die $DBI::errstr; $self->{_DATA_}->{RESULTS} = $sth; } sub get { my $self = shift; my $sth = $self->{_DATA_}->{RESULTS}; return $sth->fetchrow_hashref; } 1;