my %foo = ( ebay => 'ebay.com', google => 'google.com', yahoo => 'yahoo.com' ); # The above hash assumes that no two links will ever be the same. # If they might be, but the URL isn't, just switch the order.