+sub acct_sql_replace { #subroutine, not method
+ my $dbh = acct_sql_connect(shift, shift, shift);
+ my( $table, $pkey, $old_pkey, %record ) = @_;
+
+ my $sth = $dbh->prepare(
+ "UPDATE $table SET ". join(', ', map "$_ = ?", keys %record ).
+ "WHERE $pkey = ?"
+ ) or die $dbh->errstr;
+
+ $sth->execute( values(%record), $old_pkey );
+
+ $dbh->disconnect;
+}
+