The prototypical Casimir effect arises when a scalar field is confined between parallel Dirichlet boundaries. We study corrections to this when the boundaries themselves have apertures and edges. We consider several geometries: a single plate with a slit in it, perpendicular plates separated by a gap, and two parallel plates, one of which has a long slit of large width, related to the case of one plate being semi-infinite. We develop a general formalism for studying such problems, based on the wavefunctional for the field in the gap between the plates. This formalism leads to a lower dimensional theory defined on the open regions of the plates or boundaries. The Casimir energy is then given in terms of the determinant of the nonlocal differential operator which defines the lower dimensional theory. We develop perturbative methods for computing these determinants. Our results are in good agreement with known results based on Monte Carlo simulations. The method is well suited to isolating the diffractive contributions to the Casimir energy.