use strict; my (@a, @b); @a = (1,2,3); @b = (5,6,7); { my %test; @test{@a,@b}=1; print scalar keys %test == 6 ? 'ok' : 'not'; } # ok @a = (1,2,3); @b = (2,4,6); { my %test; @test{@a,@b}=1; print scalar keys %test == 6 ? 'ok' : 'not'; } # not