POD + perltidy?

perrin on 2007-01-09T23:46:44

Does anyone have a handy way to run perltidy on code embedded in POD? It feels very backwards to be indenting that by hand when I run perltidy for everything else. Maybe an extension to Pod::Tidy?


If you use vim ...

Ovid on 2007-01-10T07:39:57

This is a bit of a hack, but if you use vim, try this:

vnoremap ,pt :!perltidy<cr>

Then, if you enter visual mode (hitting ctrl-v and selecting the lines you want), you can just type ,pt and it will reformat the lines you've selected -- event if they're in POD. You'll still need to bump them over a space, but it's better than nothing!

I'm sure emacs has something similar, I just don't know what it is.

For Emacs users

arc on 2007-01-11T10:54:19

The Emacs equivalent is shell-command-on-region, which is bound to M-| by default. To tidy the region, type C-u M-| perltidy RET