I've always used this: XS(XS_Const_const) { register int i; dXSARGS; for (i = 0; i < items; i++) { SvREADONLY_on(ST(i)); } XSRETURN(1); } XS(boot_Const) { dXSARGS; char* file = __FILE__; newXS("Const::const", XS_Const_const, file); ST(0) = &sv_yes; XSRETURN(1); } Its manpage is: NAME Const - Perl module that sets variables to readonly SYNOPSIS use Const; ... const $a = 3, $b = 2; ... $b = 1; # Error: $b is read only DESCRIPTION This package implements only one function, const. Any variable given as an argument to const will be marked so that subsequent assignment will result in an error. The result of providing a non-scalar argument is undefined. const returns its first argument. AUTHOR William Setzer <William_Setzer@ncsu.edu> --tom