The next to the leading order Casimir effect for a real scalar field, within $phi^4$ theory, confined between two parallel plates is calculated in one spatial dimension. Here we use the Greens function with the Dirichlet boundary condition on both walls. In this paper we introduce a systematic perturbation expansion in which the counterterms automatically turn out to be consistent with the boundary conditions. This will inevitably lead to nontrivial position dependence for physical quantities, as a manifestation of the breaking of the translational invariance. This is in contrast to the usual usage of the counterterms, in problems with nontrivial boundary conditions, which are either completely derived from the free cases or at most supplemented with the addition of counterterms only at the boundaries. We obtain emph{finite} results for the massive and massless cases, in sharp contrast to some of the other reported results. Secondly, and probably less importantly, we use a supplementary renormalization procedure in addition to the usual regularization and renormalization programs, which makes the usage of any analytic continuation techniques unnecessary.