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:
See the section of Synopsis 3 on declarators for more info.constant $PI = 3.141593;
This should be easy to hack into perl5 for scalars, but I'm not sure about arrays and such.
In reply to Re: What is the difference between the constant construct in Perl and the Readonly construct in Perl?
by duff
in thread What is the difference between the constant construct in Perl and the Readonly construct in Perl?
by jira0004
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |