|
10.03.08
Perltidy Offers Reformatting Help
By
Doug Caverly
Take a look at any car that's littered with empty coke bottles and mangled takeout bags. Or any desk that's covered with bent pieces of paper and a dozen redundancies in terms of office supplies. Being neat is so much better, and Perltidy aims to help Perl experts achieve that state.
Juliet Kemp describes Perltidy as "a program generated from the Perl module Perl::Tidy, which saves you time by unmangling Perl code for you. You can download it from CPAN, or it may be available through your distro. (Debian and Ubuntu both provide it.)"
And at this point, you should be more or less set with just one or two more pieces of instruction.
Join
the Mosso Hosting Cloud.
Easy. Powerful. Scalable. Learn
More |
Kemp continues, "Basic operation is simply to type perltidy badscript.pl. This will leave the initial file alone and create a new tidied-up file with a .tdy extension. Alternatively, you can use the -b switch to do the opposite: Make a backup of the original file and then edit it in-line. The -syn switch will run a syntax check of the original code at the same time."
Don't think that Perltidy is some miracle worker that will solve all of your problems. Kemp tested the program on a pretty messy lump code, however, and Perltidy made a definite improvement.
Considering how simple using Perltidy is compared to getting out trash bags, gloves, and bottles of bleach, almost everyone should find that it's worth a look.
About
the Author: Doug is a staff writer for WebProNews.
Visit WebProNews for the latest eBusiness news.
|
|