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"; } #### my %hash = ( 1 => artistsong1, 3 => artistsong1, 5 => artistsong1, 2 => artistsong2, 4 => artistsong2, 6 => artistsong3, 7 => artistsong3 ); # to find where 1 is? my $artistsong = $hash{1};