in reply to Re: Re: Re: There is a way to LOCK a SCALAR?
in thread There is a way to LOCK a SCALAR?

Yes you are right!

I found a module to set the readonly flag in the scalar:

Internals::SetReadOnly(\$foo);
But the user still can use the same module to unset the flag! ;-P

Soo, using tie or XS to make this will be the same! Maybe I will use tie, since it's pure Perl and I'm already using a lot of tie in the enverioment for other things.

Graciliano M. P.
"Creativity is the expression of the liberty".

Replies are listed 'Best First'.
Re: Re: Re: Re: Re: There is a way to LOCK a SCALAR?
by duff (Parson) on Dec 19, 2003 at 01:42 UTC

    You can always add

    sub UNTIE { die "Don't do that!" }

    to the class too. :-)

Re: Re: Re: Re: Re: There is a way to LOCK a SCALAR?
by BUU (Prior) on Dec 18, 2003 at 22:29 UTC
    I think my point that in this case education would be better then chains. As in, tell your users/developers why you shouldn't mess with this scalar instead of trying to devise elaborate hacks to not let them.