in reply to Re: problem in queue implementation
in thread problem in queue implementation

thanks a lot ikegami....your suggestion worked beautifully..!!

I am just new to perl so facing all such kind of problems.

In addition of above similar problem one more doubt i want u to clear...

    if I want to enqueue arrays executed by $sth->fetchrow in a queue for the usage of same queue to later purpose then what should i do means how to get reference of executed rows from result set ??

Replies are listed 'Best First'.
Re^3: problem in queue implementation
by ikegami (Patriarch) on Oct 15, 2009 at 12:53 UTC

    Did you want each row to be a different queue item?

    while (my $row = $sth->fetch()) { # Must copy since fetch reuses array. $row = [ @$row ]; $q->enqueue(share($row)); }

    You will be using threads right? Otherwise a queue is simply:

    my @queue; # Put stuff in while (...) { push @queue, ...; } # Take stuff out while (@queue) { my $item = shift(@queue); ... }