Stories
Slash Boxes
Comments

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

perrin (4270)

perrin
  (email not shown publicly)

Perrin is a contributor to various Perl-related projects like mod_perl, Template Toolkit, and Class::DBI. He is a frequent speaker at OSCON, YAPC, and ApacheCon, and a contributor to several perl-related books.

Journal of perrin (4270)

Tuesday January 09, 2007
07:46 PM

POD + perltidy?

[ #32108 ]

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?

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • 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.

    • 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