{ no strict 'refs'; my @incs = qw( index chapter index pages names ); for my $i (@incs) { ${"total_$i"} += $$i; } }