$sth = $dbh->prepare($q) or die $dbh->errstr; #the below includes 'id' which is auto_increment my @fields = ('id','Symbol','Company Name','Last Price',....,'Market-cap'); my @symbols = ('AA','C'); useRealtimeQueryFormat(); my @quotes = getquote(@symbols); while ($cc < 22222) { $cc++; foreach my $q (@quotes) { my @h = @{$q}; join("\t",@h),"\n"; my $c = @h; for ( my $i = 0 ; $i < $c ; $i++ ) { my $j = 1+ $i; $h[$i] =~ s/ +//; $h[$i] =~ s/ %//; $h[$i] = ($h[$i] eq 'N/A') ? undef : $h[$i]; } $sth->execute(@h); } }