We propose a type of all-optical switch which consists of two periodically modulated nonlinear optical waveguides placed in parallel. Compared to the all-optical switch based on the traditional nonlinear directional coupler without periodic modulation, this all-optical switch has much lower switching threshold power and sharper switching width.