http://qs1969.pair.com?node_id=278979


in reply to Pair of items

Note: this would fail if you had repeated numbers inside an item, like (1,1,2).

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