Don'y Use $_ for a list in the same loop for two times.foreach (@Geo_areas) { $_ or next; my $Return_results = "Select * from Result_storage_keep where Ag +gregated_area LIKE '".$_."' \;"; my $sth_C = $dbh->prepare($Return_results) or die "Couldn't prep +are query: ".$dbh->errstr; $sth_C->execute() or die "Couldn't execute query: ".$sth_C->errs +tr; while (my @row = $sth_C->fetchrow_array) { foreach my $val (@row) { $val = '' unless defined; } print OUTPUT_FILE join("\t", @row); print OUTPUT_FILE "\n"; undef @row; } }
In reply to Re: while (my @row = $sth->fetchrow_array)
by jesuashok
in thread while (my @row = $sth->fetchrow_array)
by Win
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |