From: Muma W. [mailto:[EMAIL PROTECTED]
Sent: Friday, June 23, 2006 4:11 PM
To: Beginners List
Subject: Re: Can't use string ("3862926") as a HASH ref while "strict
refs"
Moon, John wrote:
> [...]
> 150 $totals{$fund}{$service}{$acct}{AMT} += $amt;
> 151 $totals{$fund}{$service}{$acct}{QTY} += $n_qty;
> 152 $totals{$fund}{$service}{AMT} += $amt;
> 153 $totals{$fund}{$service}{QTY} += $n_qty;
> 154 $totals{$fund} += $amt;
> [...]
I think this is the problem. There is a conflict between making
$totals{$fund} a hash reference (lines 150-153) and making it a number
(line 154).
The same conflict exists between lines 150-151 and lines 152-153. I
don't know much about your data, but I might do it like this:
$totals{$fund}{$service}{$acct}{AMT} += $amt;
$totals{$fund}{$service}{$acct}{QTY} += $n_qty;
$totals{$fund}{$service}{total}{AMT} += $amt;
$totals{$fund}{$service}{total}{QTY} += $n_qty;
$totals{$fund}{total}{total}{total} += $amt;
IOW, you (probably) need to keep the depths the same.
HTH
Thank you...
jwm
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>