niXforums Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   PreferencesPreferences   Log in to check your private messagesLog in to check your private messages   Log inLog in 
·  nixdoc.net ·  man pages ·  Linux HOWTOs ·  FreeBSD Tips ·  Forums
navigation Forum index » Programming » Perl
FAQ 3.8 Is there a pretty-printer (formatter) for Perl?
Post new topic   Reply to topic Page 1 of 1 [1 Post] View previous topic :: View next topic
Author Message
PerlFAQ Server
*nix forums Guru


Joined: 09 Apr 2005
Posts: 1008

PostPosted: Thu Jul 20, 2006 7:03 pm    Post subject: FAQ 3.8 Is there a pretty-printer (formatter) for Perl? Reply with quote

This is an excerpt from the latest version perlfaq3.pod, which
comes with the standard Perl distribution. These postings aim to
reduce the number of repeated questions as well as allow the community
to review and update the answers. The latest version of the complete
perlfaq is at http://faq.perl.org .

--------------------------------------------------------------------

3.8: Is there a pretty-printer (formatter) for Perl?

Perltidy is a Perl script which indents and reformats Perl scripts to
make them easier to read by trying to follow the rules of the perlstyle.
If you write Perl scripts, or spend much time reading them, you will
probably find it useful. It is available at
http://perltidy.sourceforge.net

Of course, if you simply follow the guidelines in perlstyle, you
shouldn't need to reformat. The habit of formatting your code as you
write it will help prevent bugs. Your editor can and should help you
with this. The perl-mode or newer cperl-mode for emacs can provide
remarkable amounts of help with most (but not all) code, and even less
programmable editors can provide significant assistance. Tom
Christiansen and many other VI users swear by the following settings in
vi and its clones:

set ai sw=4
map! ^O {^M}^[O^T

Put that in your .exrc file (replacing the caret characters with control
characters) and away you go. In insert mode, ^T is for indenting, ^D is
for undenting, and ^O is for blockdenting--as it were. A more complete
example, with comments, can be found at
http://www.cpan.org/authors/id/TOMC/scripts/toms.exrc.gz

The a2ps http://www-inf.enst.fr/%7Edemaille/a2ps/black+white.ps.gz does
lots of things related to generating nicely printed output of documents,
as does enscript at http://people.ssh.fi/mtr/genscript/ .



--------------------------------------------------------------------

The perlfaq-workers, a group of volunteers, maintain the perlfaq. They
are not necessarily experts in every domain where Perl might show up,
so please include as much information as possible and relevant in any
corrections. The perlfaq-workers also don't have access to every
operating system or platform, so please include relevant details for
corrections to examples that do not work on particular platforms.
Working code is greatly appreciated.

If you'd like to help maintain the perlfaq, see the details in
perlfaq.pod.

--
Posted via a free Usenet account from http://www.teranews.com
Back to top
Google

Back to top
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [1 Post] View previous topic :: View next topic
The time now is Mon Dec 01, 2008 7:43 pm | All times are GMT
navigation Forum index » Programming » Perl
Jump to:  

Similar Topics
Topic Author Forum Replies Last Post
No new posts Need Help with Program in Perl on a Netware Server fhadzocos@gmail.com Perl 3 Fri Jul 21, 2006 1:57 pm
No new posts problems using oddmuse with mod_perl2 inside apache2.2 pe... Fergus McMenemie Perl 0 Fri Jul 21, 2006 9:48 am
No new posts make printer network available Johann Höchtl networking 0 Fri Jul 21, 2006 9:01 am
No new posts Problem with Win32-SerialPort over bluetooth @ windows + ... ctloh Perl 0 Fri Jul 21, 2006 8:08 am
No new posts Posting Guidelines for comp.lang.perl.misc (: 1.... Tad McClellan Perl 0 Fri Jul 21, 2006 7:22 am

Mortgage | Advertising | Hotel Portal France, Italy, UK | Credit Report | Literatura fantastica
Copyright © 2004-2005 DeniX Solutions SRL
 
Other DeniX Solutions sites: Unix/Linux blog |  electronics forum |  medicine forum |  science forum | 
Privacy Policy


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 1.7133s ][ Queries: 16 (1.6309s) ][ GZIP on - Debug on ]