my $row; for ( my $i = 0 ; $i < @stockDataArray; $i++ ) { ... $row = $rtTrade->makeRowArray... $queue->enqueue($row);