in reply to Thread::Queue::Any->dequeue trouble

Call $QUEUE->dequeue() in list context:

my ($time) = $QUEUE->dequeue()

Replies are listed 'Best First'.
Re^2: Thread::Queue::Any->dequeue trouble
by mrd (Beadle) on Aug 26, 2005 at 07:13 UTC
    Thanks. That works.

    But then the docs are misleading. Quote from perldoc Thread::Queue::Any:

    dequeue
    ($string,$scalar,$listref,$hashref) = $queue->dequeue;

    The "dequeue" method removes a reference from the head of the queue, dereferences it and returns the resulting values. If the queue is currently empty, "dequeue" will block the thread until another thread "enqueue"s.

    If I enqueue() a scalar I expect to dequeue() a scalar and not a list.