develooper Front page | perl.perl5.porters | Postings from May 2000

Re: Proposed pragma: readonly

Mark Summerfield
May 20, 2000 11:18
Re: Proposed pragma: readonly
Message ID:
Mark, Andreas, Tom,

Mark-Jason Dominus wrote:
> Andreas J. Koenig wrote:
> >
> > I found again Graham's posting with a tie() solution for scalars,
> > arrays and hashes:
> >
> >
> The module does something similar:

Yes I did a tied implementation myself originally a few years back:
	Tie::Const at
but the problem with the tie approach is they make constants slower when
constants should surely be faster!

The solution Tom uses looks ideal, no tie slowdown, you can make
something const at runtime which is a bonus. Only downside is it isn't
in the std distrib or on CPAN...
I'll try it (never done any XS before, the "make && make test && make
install" incantation does all that for me) & let you know.

Mark Summerfield Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About