my %hash = ( artistsong1 => { 1 => 1, 3 => 1, 5 => 1 }, artistsong2 => { 2 => 1, 4 => 1 } ); # to find for ArtistSong1, does 1 exist? if($hash{artistsong1}->{1}) { print "yes, 1 does exist for artistsong1!\n"; }