http://www.perlmonks.org?node_id=1153714


in reply to Re: Readonly oddity
in thread Readonly oddity

I don't agree with this advice either. I personally don't like constant because it is not suitable for any complex structures and you can't interpolate those constants in strings. Neither I like Readonly because you have to type "Readonly", which is quite a lot and the capital 'R' makes it simply unbearable. So I use Const::Fast.

Replies are listed 'Best First'.
Re^3: Readonly oddity
by dmitri (Priest) on Jan 27, 2016 at 01:06 UTC
    > I personally don't like constant because it is not suitable for any complex structures

    For example?

      The documentation for constant explains this.

      "For example?"

      The NOTES section of that documentation has an example.

      — Ken

        You mean the array reference example? It only says that you can change the values, not that it's "not suitable." It's quite suitable, I use it all the time.