in reply to What is the difference between the constant construct in Perl and the Readonly construct in Perl?

If some more of perl6 makes it into perl5 we might have a third option before long--a constant declarator. Here's what it will look like in perl6:

constant $PI = 3.141593;
See the section of Synopsis 3 on declarators for more info.

This should be easy to hack into perl5 for scalars, but I'm not sure about arrays and such.

  • Comment on Re: What is the difference between the constant construct in Perl and the Readonly construct in Perl?
  • Select or Download Code