use strict; use warnings; use Data::Dumper; $Data::Dumper::Indent = 1; my %hash = ( foo => 1, bar => 2, baz => 3, quux => 4 ); my @a = qw(foo bar asdf); my @b = qw(baz); ++@hash{@a,@b}; print Dumper \%hash;