*** a/src/pl/plperl/plperl.c
--- b/src/pl/plperl/plperl.c
***************
*** 2021,2027 **** plperl_return_next(SV *sv)
  
  		if (SvOK(sv))
  		{
! 			char	   *val = SvPV(sv, PL_na);
  
  			ret = InputFunctionCall(&prodesc->result_in_func, val,
  									prodesc->result_typioparam, -1);
--- 2021,2035 ----
  
  		if (SvOK(sv))
  		{
! 			char	   *val;
! 
! 			if (prodesc->fn_retisarray && SvROK(sv) &&
! 				SvTYPE(SvRV(sv)) == SVt_PVAV)
! 			{
! 				sv = plperl_convert_to_pg_array(sv);
! 			}
! 
! 			val = SvPV(sv, PL_na);
  
  			ret = InputFunctionCall(&prodesc->result_in_func, val,
  									prodesc->result_typioparam, -1);
