in reply to How do I initiate a constant with variable value?
my $someVar = "someValue"; sub get_cnst { return $someVar; }
In this way, the variable is readable but not writable from outside the module. Is there a particular reason it needs to be a simple scalar?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How do I initiate a constant with variable value?
by accessdenied (Acolyte) on Jun 04, 2010 at 13:53 UTC | |
by kennethk (Abbot) on Jun 04, 2010 at 13:58 UTC | |
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 |