On Fri, 2006-23-06 at 13:36 -0400, Moon, John wrote: > 1 #! /usr/local/bin/perl -d > 2 use strict; > 106 my ($prev_fund, $prev_service, $prev_acct); > 107 my %totals=(); > 108 while ($sth->fetch) { > 109 if ($fund ne $prev_fund) { > 110 > &PrintAcctTotal($totals{$prev_fund}{$prev_service}{$prev_acct}{AMT}, > 111 > $totals{$prev_fund}{$prev_service}{$prev_acct}{QTY}); > 112 > &PrintServiceTotal($totals{$prev_fund}{$prev_service}{AMT}, > 113 $totals{$prev_fund}{$prev_service}{QTY}); > 114 &PrintFundTotal($totals{$prev_fund}); > 115 } > 116 elsif ($service ne $prev_service) {
Examine %totals here. (You can also add the following to get %totals displayed on STDOUT: use Data::Dumper; print Dumper \%totals; # %totals will be called $VAR1 ) > 117 print > "(prev_fund,prev_service)=<$prev_fund,$prev_service>\n"; > 118 print "value > =<$totals{$prev_fund}{$prev_service}{AMT}>\n"; This is generating an error because you are going (at least) one level too deep. In other words, %totals doesn't have the structure you think it has. -- __END__ Just my 0.00000002 million dollars worth, --- Shawn "For the things we have to learn before we can do them, we learn by doing them." Aristotle * Perl tutorials at http://perlmonks.org/?node=Tutorials * A searchable perldoc is at http://perldoc.perl.org/ -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>