#! /usr/bin/perl -w use strict; my( %totals, %delta ); my @fields = qw/foo bar/; @totals{ @fields } = ( 10, 20 ); @delta{ @fields } = ( 5, 6 ); # the wish # @totals{ @fields } += @delta{ @fields }; # the reality $totals{$_} += $delta{$_} foreach( @fields ); use Data::Dumper; print Dumper( \%totals );