global variables in threaded perl programs

global variables in threaded perl programs

am 13.04.2008 02:23:21 von unknown

Post removed (X-No-Archive: yes)

Re: global variables in threaded perl programs

am 13.04.2008 02:28:13 von Joost Diepenmaat

iloveperl@abc.com writes:

> In the above code it starts two threads in which global variables are
> set to a value.
> output of the program
>
> 1000
> 2000
> current 0 0..
>
> why does the last print line does not take the value of 1000 or 2000.

Because no variables are shared by default. See perldoc threads::shared

--
Joost Diepenmaat | blog: http://joost.zeekat.nl/ | work: http://zeekat.nl/