wbirkett has asked for the wisdom of the Perl Monks concerning the following question:
At this point, the vector elements can be changed, so I make them read-only using the 'Internals' module.# constants use constant D50 => [96.42, 100, 82.49]; # ICC D50 XYZ
This seems to work fine, but now I read from 'Internals.pod':use Internals qw(SetReadOnly); # set constant array elements to be read-only for (@{(D50)}) {SetReadOnly(\$_)}
'In practice people have come to depend on these over the years, despite being historically undocumented, so we will provide some level of forward compatibility for some time. Nevertheless you can assume that any routine documented here is experimental or deprecated and you should find alternatives to their use.'
So, is there a better alternative for making a constant vector?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: constant vector (updated x2)
by haukex (Archbishop) on Aug 01, 2017 at 11:07 UTC | |
by LanX (Saint) on Aug 01, 2017 at 11:27 UTC | |
|
Re: constant vector
by LanX (Saint) on Aug 01, 2017 at 11:13 UTC | |
by wbirkett (Acolyte) on Aug 01, 2017 at 11:37 UTC | |
by haukex (Archbishop) on Aug 01, 2017 at 12:08 UTC | |
by LanX (Saint) on Aug 01, 2017 at 13:03 UTC |