packetstormer has asked for the wisdom of the Perl Monks concerning the following question:
The problem is that, near the end, in the while($query_handle->fetch()) part. If I print the the $get_file I get a list of each row as planned. However, if I push that string into the array and then print the array I get a really long list of duplicate entries!
Can anyone see my mistake?....... my $dsn = "dbi:$platform:$database:$host:$port"; my $connect = DBI->connect($dsn, $user, $pw); foreach my $k(@shows_array) { my($show_id,$title,$next_episode) = split(/\|/,$k); my $query = "SELECT count(episode) from shows where episode = \"$next_ +episode\""; my $query_handle = $connect->prepare($query); $query_handle->execute(); $query_handle->bind_columns(\$episode); { if($episode eq "0") { $get_file = "$url$title"." "."$next_episode"."&catid=$cati +d"."&num=".$num."&age="."$age"."&username=".$username."&".$apikey; #print "<br />".$get_file."<br />"; #THE PRINT ABOVE OUTPUTS FINE push(@nzb_list,$get_file); print @nzb_list; #THE PRINT ABOVE IS THE PROBLEM }; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Strange loop output
by wind (Priest) on Apr 21, 2011 at 08:10 UTC | |
by packetstormer (Monk) on Apr 21, 2011 at 08:13 UTC | |
by packetstormer (Monk) on Apr 21, 2011 at 08:18 UTC | |
by moritz (Cardinal) on Apr 21, 2011 at 08:30 UTC |