Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
.... my $sth = $dbh->prepare($sql); $sth->execute() || die $sth->errstr; #test values here::: #use Data::Dumper; #my $array_ref = $sth->fetchall_arrayref; #print Dumper $array_ref; #end test::: my $array_ref = $sth->fetchall_arrayref(); foreach $row (@$array_ref) { ($type, $total) = @$row; if ($type eq "A"){$a = $total;} if ($type eq "B"){$b = $total;} if ($type eq "C"){$c = $total;} if ($type eq "D"){$d = $total;} if ($type eq "W"){$w = $total;} } $total = $a + $b + $c + $d + $w; print "$w\n"; print "$total\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Extra Space Issue
by Fletch (Bishop) on Jan 31, 2008 at 15:12 UTC | |
|
Re: Extra Space Issue
by pilcrow (Sexton) on Jan 31, 2008 at 16:29 UTC | |
|
Re: Extra Space Issue
by toolic (Bishop) on Jan 31, 2008 at 15:11 UTC | |
|
Re: Extra Space Issue
by KurtSchwind (Chaplain) on Jan 31, 2008 at 15:11 UTC | |
by grinder (Bishop) on Jan 31, 2008 at 16:17 UTC | |
|
Re: Extra Space Issue
by Anonymous Monk on Jan 31, 2008 at 15:20 UTC |