You are hiding the shared queue, because you have a my @queue in your code.
Additionally there is no lock statement anywhere, thus this will never ever be thread-safe. If you want to extent Thread::Queue, you should first read the thread tutorial and look at the implementation of Thread::Queue in the lib directory.
I would suggest that you copy the enqueue code into a new function and change it to work inside the queue. The implementation of the Thread::Queue shows you the difficulty of working with threads in a safe way...

In reply to Re: Shared variable not changing? by weismat
in thread Shared variable not changing? by Shades

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":