in reply to Copy an object
As VSarkiss already mentioned, it makes little sense to pass the statement handle ($sth) back from the subroutine.# example my $dbh = DBI->connect( ... ); #... my @row = doSelect($dbh, 'foobar'); #... sub doSelect{ my ($dbh, $table) = @_; my $sth = $dbh->prepare("SELECT * FROM $table LIMIT 1"); $sth->execute(); return $sth->fetchrow_array(); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(cLive ;-) Re: Copy an object
by cLive ;-) (Prior) on Apr 26, 2002 at 07:13 UTC |