Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a definitive Perl style guide? [closed]

Tags:

perl

I'm wondering if there's a document or a page which has a style guide for Perl. For example, this is one that I use for C++: https://google-styleguide.googlecode.com/svn/trunk/cppguide.html.

Is there a style guide for Perl that most people use / follow?

like image 974
SelfTaught Avatar asked Sep 17 '25 20:09

SelfTaught


2 Answers

There's perldoc perlstyle in the standard documentation.

Regarding aesthetics of code lay out, about the only thing Larry cares strongly about is that the closing curly bracket of a multi-line BLOCK should line up with the keyword that started the construct. Beyond that, he has other preferences that aren't so strong..

.. Larry has his reasons for each of these things, but he doesn't claim that everyone else's mind works the same as his does.

If you install the Perl::Tidy module it includes the program/tool perltidy that will reformat your code to conform to Larry Wall's preferences as expressed in perlstyle. With the command line parameter -pbp it will instead conform to the style preferences Damian Conway expressed in his book Perl Best Practices.

like image 67
Jim Davis Avatar answered Sep 19 '25 10:09

Jim Davis


There is a Perl Style guide written by Tom Christiansen, who is one of the top Perlers out there.

like image 44
Degustaf Avatar answered Sep 19 '25 09:09

Degustaf