in reply to Re: How do I initiate a constant with variable value?
in thread How do I initiate a constant with variable value?
Tried so many times so I forgot to mention additional requirements, sorry.
I don't like using getter because there are several scripts which uses module and several modules also, so number of getters and calls to them becomes big. Calls costs time and my task is optimisation so I would like to avoid getters.
By the way, I found that constants in Perl actually implemented by subs, so each mention of constant is actually call to sub which returns value. As for me this looks like having getters. So, looks like I don't need constants really. I need some way to define readonly object without use of additional modules and other time-spending things.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: How do I initiate a constant with variable value?
by kennethk (Abbot) on Jun 04, 2010 at 13:58 UTC | |
|
Re^3: How do I initiate a constant with variable value?
by Corion (Patriarch) on Jun 04, 2010 at 13:56 UTC | |
by accessdenied (Acolyte) on Jun 04, 2010 at 14:00 UTC | |
by Corion (Patriarch) on Jun 04, 2010 at 14:05 UTC |