RE: shared variablrd and "require" (or "do")

[email protected] ("Jerry D. Hedden") Tue, 25 Jul 2006 08:34:12 -0700
Newsgroups perl.ithreads
Message-ID <20060725083412.fb30e530d17747c2b054d625b8945d88.6f238ee8f3.wbe@email.secureserver.net>
kristoff bonne wrote:
> To keep my programs a bit managable, I had the habit to split up my 
> program into different files (one main program and a number of related 
> subs into one or multiple .pm files).
> 
> I "include" these programs into the main program using a "require".
> 
> Now, by starting to use threads, I noticed that shared variables are not 
> shared anymore when they are found in different files. (so the "require" 
> command, is not exactly the same thing as a "include" in C).
> 
> I tried using "do" instead of "require" but I have the same result.
> 
> Is there a way to split up a program into multiple programs (subs 
> running as threads) and still have data shared between the subs 
> (threads) found in different files?

It would be very helpful if you would post a "complete" example that
shows the problem you're having.