foo * routine(a, b, c=NULL) SV * a SV * b SV * c INIT: ... if(!SvROK(c)) croak("Expected reference"); CODE: { SV * str = SvRV(c); }