- or download this
if (my $totalvar = $totals{ $id }) {
$$totalvar += $amt;
}
- or download this
if( defined $total{$id} ){
$total{$id} += $amt;
}else{
$total{tocredit} += $amt;
}
- or download this
my $sth = $dbh->prepare('select * from accounts where id = ?');
$sth->execute($current_account_id);
...
# a naive way
my %totals = %{$hr};