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?
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
.
There is a Perl Style guide written by Tom Christiansen, who is one of the top Perlers out there.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With