# 13 is in list 1 # 23 is in list 5 and 6 # 42 is in list 1,3 and 5 my %lists; @lists{13,23,42}=([1],[5,6],[1,3,4]); # Find which lists contain the values for my $i (13,23,42) { print "Value $i found in list $_\n" foreach (@{$lists{$i}}) }