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

Other than just the above mentioned it also allows you to assign an array or hash directly as Readonly.
Readonly my @vals => (1,2,3,4); Readonly my %vals => (1=>2);
If I am not mistaken constant is also assigned at compile time. So using Readonly inside a function to take the parameters would work, the same would not work for constant.

Cheers,
PerlingTheUK
  • Comment on Re: What is the difference between the constant construct in Perl and the Readonly construct in Perl?
  • Download Code