global variables in threaded perl programs

Post removed (X-No-Archive: yes)
Notifier Deamon [ So, 13 April 2008 02:23 ] [ ID #1941663 ]

Re: global variables in threaded perl programs

iloveperl [at] 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/
Joost Diepenmaat [ So, 13 April 2008 02:28 ] [ ID #1941664 ]
Perl » comp.lang.perl.misc » global variables in threaded perl programs

Vorheriges Thema: FAQ 8.46 What's the difference between require and use?
Nächstes Thema: FAQ 9.1 What is the correct form of response from a CGI script?