At 01:43 PM 10/27/02 +0200, Elizabeth Mattijsen wrote:
Try:At 06:01 PM 10/26/02 -1000, Joshua Hoblitt wrote:I was wondering why: -- my( $one, $two ) = @{ $q->dequeue_dontwait }; print "$one, $two\n";
my( $one, $two ) = @{ ($q->dequeue_dontwait)[0] };
The @{ } forces scalar context within the {}, so it is trying to dereference "1" (being the number of elements returned). Which you will see if you add:
use strict;
(which you should probably always do anyway).
I could probably change the dequeuexxx routines of Thread::Queue::Any to return the first element only if called in a scalar context. However, this would add a significant amount of overhead in otherwise very lean methods, so I'm a bit reluctant to do this.
Opinions anyone?
Liz