|Perl Monk, Perl Meditation|
Re^3: How will you use state declared variables in Perl6?by BrowserUk (Pope)
|on Jul 08, 2005 at 23:14 UTC||Need Help??|
Hmm. I would need to understand the difference between state and local, and the scope on the namespace in which state variables live.
Ie. Does state $foo; refer to the same thing across packages, files, modules, threads?
In single threaded apps, a truely global (process wide) variable type has uses for things like DB handles, file handles, sockets, ports, etc. anything that is a truely process global entity.
Once you introduce threads into the equations, things get sticky. It very much depends upon the threading models supported by the OS and which of those models is used by libraries supplying services to your process as to whether things like DB handles can be safely used across threads or not.
One assumes that the state keyword came into being in order to support a particular scenario. A good description of that scenario, and the implications of would be nice to see.
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
"Science is about questioning the status quo. Questioning authority".
The "good enough" maybe good enough for the now, and perfection maybe unobtainable, but that should not preclude us from striving for perfection, when time, circumstance or desire allow.