D
Dave Slayton
Ok, let's see if I may ask a fairly basic question (as opposed to an
advanced one) and get a useful answer. I hope so.
I see that this:
*PI = \3.14159265358979;
will create a constant that I may not change. Sure, why change $PI anyway,
even if you could, otherwise why set up the constant in the first place?
But, if I understand, it only modifies the scalar entry in the *PI typeglob,
making it refer now to some address in memory that holds this value for pi.
So I don't see why it should be IMPOSSIBLE to change its value, unless
there's something I don't yet understand about typeglobs. It would make
sense if it's merely POLICY, and if, for instance, it's implemented by Perl
underneath as a pointer to constant, once Perl notices it's a reference to a
scalar literal. Would someone please offer me a little guidance on this
issue? Thanks!
advanced one) and get a useful answer. I hope so.
I see that this:
*PI = \3.14159265358979;
will create a constant that I may not change. Sure, why change $PI anyway,
even if you could, otherwise why set up the constant in the first place?
But, if I understand, it only modifies the scalar entry in the *PI typeglob,
making it refer now to some address in memory that holds this value for pi.
So I don't see why it should be IMPOSSIBLE to change its value, unless
there's something I don't yet understand about typeglobs. It would make
sense if it's merely POLICY, and if, for instance, it's implemented by Perl
underneath as a pointer to constant, once Perl notices it's a reference to a
scalar literal. Would someone please offer me a little guidance on this
issue? Thanks!