in reply to Re^2: update the hash element in side the thread loop
in thread update the hash element in side the thread loop

You've got use threads::shared; at the top of your code, but no where do you actually use it!

Ie. You never mark anything shared using my %hash :shared;, nor do you call the exported subroutine share() anywhere.

These are the only ways that threads can share variables. Without them, each thread will be operating on different variables (with the same name!).

What difference does it make to how your program runs if you add?

my %hash :shared;

Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
RIP PCW It is as I've been saying!(Audio until 20090817)

Replies are listed 'Best First'.
Re^4: update the hash element in side the thread loop
by nagivreddy93 (Novice) on Nov 30, 2009 at 15:19 UTC
    Thank you very much