Domain walls in ferroelectrics and ferroelastics often present peculiar functional properties, offering an intriguing route toward the design of nano-devices. Here we use first-principles simulations to illustrate an approach for engineering such walls, working with representative ferroelastic perovskites LaGaO 3 and CaTiO 3 (insulating, non-magnetic, non-polar). We show that a wide range of substitutional dopants can be used to create long-range-ordered structures confined within the walls of these compounds, yielding functional interfaces with tailor-made properties. We thus identify clear-cut strategies to produce metallic walls within an insulating matrix. Further, we find ways to create magnetic walls that also display ferroelectric order (proper or improper), thus providing an original route to obtain magnetoelectric multiferroics. Given the recent developments on the preparation of high-density domain structures in perovskite films, our results suggest a definite path toward new functional nano-materials.