Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Are file scoped variables in a module duplicated with each class instantiation?

0 views
Skip to first unread message

s...@netherlands.com

unread,
Dec 11, 2008, 1:38:28 PM12/11/08
to
I have a large hash that is file scoped, a lexical in the module.
Have to make quite a few instantiations of the class.
Is the file scoped lexical hash duplicated each time?
I wouldn't think so but does anybody know the quick answer?

Thanks!

sln

xho...@gmail.com

unread,
Dec 11, 2008, 2:52:23 PM12/11/08
to

Not unless you specifically do something which causes it be
duplicated.

Xho

--
-------------------- http://NewsReader.Com/ --------------------
The costs of publication of this article were defrayed in part by the
payment of page charges. This article must therefore be hereby marked
advertisement in accordance with 18 U.S.C. Section 1734 solely to indicate
this fact.

Jim Gibson

unread,
Dec 11, 2008, 3:27:33 PM12/11/08
to
In article <ltm2k413pdreg7t5c...@4ax.com>,
<s...@netherlands.com> wrote:

No. There is only one hash. Your file gets read and compiled only once.
There is only one lexical variable with the name of your hash. Any
instance of your class calls the methods that are defined in your class
file. Each of those methods will access the same lexical variable for
your hash. There is only one.

--
Jim Gibson

s...@netherlands.com

unread,
Dec 11, 2008, 5:32:29 PM12/11/08
to
Thank you!

sln

0 new messages