use Class::HPLOO ; class Point { sub Point ($x , $y) { $this->{x} = $x ; $this->{y} = $y ; } sub move_x( $mv_x ) { $this->{x} += $mv_x ; } sub[C] void move_y( SV* self , int mv_y ) { SV* sv_y = *hv_fetch( (HV*)SvRV(self) , "y" , strlen("y") , 0) ; int y = SvIV(sv_y) + mv_y ; sv_setsv_mg(sv_y , sv_2mortal(newSViv(y)) ) ; } }