in reply to push leaves $#retval 0 ?

Because $#retval returns the maximum index in @retval, not the number of elements in it (use scalar @retval if that's what you want). If $#retval is 0, that means @retval contains a single value (i.e., $retval[0]).