my %totals; foreach my $func ('login','campaign','work') {    my $tmp = calc_difference($var1, $var2); $total{$func) += $tmp; }