How hash is working in this programe
===

I have seen one easy program. Well, the hole program i have understand except one thing and that is how Hash is working here : 

Program ->Extracting Unique Elements from a List
    
 

    @list = (20,30,40,60,40,20,30,2);
    @uniq = ();
    %seen = ();
    foreach $item (@list) {
        unless ($seen{$item}) 
    	{
            # if we get here, we have not seen it before
    		push(@uniq, $item);
            $seen{$item}++;
            
        }
    	print %seen;
    	print"\n";
    }




 

       My question is how hash is comparing from its exiting value to current value i.e how it is checking weather that value is already there or not .If I m printing the %seen i am getting some value.how those values are coming ?

  