/* Extract the object hash and the output filehandle. */ SV* obj_sv = ST(0); HV* obj_hash = (HV*)SvRV(obj_sv); SV* out_fh_ref = *(hv_fetch(obj_hash, "fh", 2, 0)); PerlIO* out_fh = (PerlIO*)SvRV(out_fh_ref); err = PerlIO_write( out_fh, buf_start, buf_len );