As a Filter from your Editor 

:%!perltidy -q
M-1 M-| perltidy -q