There is a readonly subroutine in Scalar::Util that you can use to do this simply, or If you have Inline available you can do this yourself trivially:
use Inline C; + my $FOO = "Bar"; + readonly($FOO); + $FOO = "GG"; __DATA__ __C__ + void readonly(SV *sv) { SvREADONLY_on(sv); }
/J\
In reply to Re: Constant string reference
by gellyfish
in thread Constant string reference
by przemo
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |