As a Filter from your Editor
Vi, select the text first, then:
:%!perltidy -q
-q
deactivates error messages
Emacs, select the text first, then:
M-1 M-| perltidy -q
Other editors are left as an exercise for the reader