At early stages of biochemical evolution, the complexity of replicating molecules was limited by unavoidably high mutation rates. In an RNA world, prior to the appearance of cellular life, an increase in molecular length, and thus in functional complexity, could have been mediated by modular evolution. We describe here a scenario in which short, replicating RNA sequences are selected to perform a simple function. Molecular function is represented through the secondary structure corresponding to each sequence, and a given target secondary structure yields the optimal function in the environment where the population evolves. The combination of independently evolved populations may have facilitated the emergence of larger molecules able to perform more complex functions (including RNA replication) that could arise as a combination of simpler ones. We quantitatively show that modular evolution has relevant advantages with respect to the direct evolution of large functional molecules, among them the allowance of higher mutation rates, the shortening of evolutionary times, and the very possibility of finding complex structures that could not be otherwise directly selected.