Agents who operate in complex environments generally obtain necessary information through their perceptions. Most commonly, these perceptions are part of the communicative process. In this paper, we present an integrated theory of perception and communication, based on the thesis that communicative acts are best understood as actions of perception. We show that an agent learns through communicative acts by combining the information that a communicative act has just occurred together with his prior knowledge. We distinguish between primary and secondary meanings in communicative actions, and give a detailed formalization of the code model to explain primary communicative actions.