my $cltid = add_client(\$dbhTarget, $clt, $passwd); ... sub add_client() { ... my $sth = $$dbh->prepare($sql) ...