else { for (values %$t_hash) { $total += $_ } # (use the statement modifier for if preferred) } #### sub sum_hash { my $href = shift; my $total = 0; for ( @_ ? @{$href}{@_} : values %$href ) { $total += $_; } return $total; }