--- plperl.c~ 2004-10-02 04:14:43.768721344 +0530 +++ plperl.c 2004-10-02 04:14:53.325733327 +0530 @@ -451,7 +451,7 @@ plperl_get_keys(HV *hv) hv_iterinit(hv); while ((val = hv_iternextsv(hv, (char **) &key, &klen))) { - av_store(ret, key_count, eval_pv(key, TRUE)); + av_store(ret, key_count, newSVpv(key, 0)); key_count++; } hv_iterinit(hv); @@ -484,11 +484,8 @@ plperl_get_key(AV *keys, int index) static char * plperl_get_elem(HV *hash, char *key) { - SV **svp; - - if (hv_exists_ent(hash, eval_pv(key, TRUE), FALSE)) - svp = hv_fetch(hash, key, strlen(key), FALSE); - else + SV **svp = hv_fetch(hash, key, strlen(key), FALSE); + if (!svp) { elog(ERROR, "plperl: key '%s' not found", key); return NULL; @@ -998,7 +995,8 @@ plperl_func_handler(PG_FUNCTION_ARGS) g_attr_num = tupdesc->natts; for (i = 0; i < tupdesc->natts; i++) - av_store(g_column_keys, i + 1, eval_pv(SPI_fname(tupdesc, i + 1), TRUE)); + av_store(g_column_keys, i + 1, + newSVpv(SPI_fname(tupdesc, i+1), 0)); slot = TupleDescGetSlot(tupdesc); funcctx->slot = slot;