[TriLUG] formatting (tabbing) perl scripts

Ed Hill ed at eh3.com
Sat Apr 24 15:35:49 EDT 2004


On Sat, 2004-04-24 at 12:57, Douglas Kojetin wrote:
> hi all-
> 
> i've got a perl script with quite a bit of code.  i had to add a few 
> more 'if/else' statements, and instead of manually tabbing everything 
> over (puts ease on my eyes), i was wondering if there was a program 
> and/or script that anyone knows of that might automagically do this for 
> me (scan through the code and tab it according to its structure)?  i've 
> seen programs that format HTML quite efficiently (html tidy, i think it 
> was called), but i haven't really looked for anything else.


Hi Douglas,

In Emacs, selecting a region followed by the command:

  ESC-x indent-region

will do what you want.  And recent versions of Emacs have a nifty
point-and-click menu (Options --> Customize Emacs) that you can use to
customize the indentation system to suit your style.

Ed

-- 
Edward H. Hill III, PhD
office:  MIT Dept. of EAPS;  Rm 54-1424;  77 Massachusetts Ave.
             Cambridge, MA 02139-4307
emails:  eh3 at mit.edu                ed at eh3.com
URLs:    http://web.mit.edu/eh3/    http://eh3.com/
phone:   617-253-0098
fax:     617-253-4464
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://www.trilug.org/pipermail/trilug/attachments/20040424/fadea858/attachment.pgp>


More information about the TriLUG mailing list