kprasanna_79 has asked for the wisdom of the Perl Monks concerning the following question:
I have to design some modules in my projects. I need the coding standards before that. I know the basic standards like
But i need to know whether any specified man page for perl coding standards. I will be thankful if u can give any of that..use strict; use warnings; pods comments for program etc..
--Prasanna.k
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: I need perl coding standards (Coding Standards References)
by eyepopslikeamosquito (Archbishop) on May 28, 2005 at 09:32 UTC | |
Basic links: Portability: Related PM Nodes:
FindBin: From CPAN: Some classic quotes from famous programmers:
Some external links: Old broken links: Note: this node was updated with new references long after originally written. | [reply] [d/l] [select] |
by adamk (Chaplain) on May 30, 2005 at 04:38 UTC | |
Many of it's points may be incorrect or not relevant for smaller projects, or projects that are not OO. | [reply] |
Re: I need perl coding standards
by Zaxo (Archbishop) on May 28, 2005 at 06:13 UTC | |
[reply] | |
Re: I need perl coding standards
by gaal (Parson) on May 28, 2005 at 06:25 UTC | |
Then read Abigail's Coding Guidelines for Perl. With any style guide there will be things you disagree with; Abigail's is notable in that everything comes with a rationale you can learn from / argue against. | [reply] |
Re: I need perl coding standards
by dbwiz (Curate) on May 28, 2005 at 07:23 UTC | |
There are no widespread standards, but you may find a few guidelines (as others have pointed out). A good one, IMO, is the Slash Style Guide. It is especially interesting because its aim is to standardize code contributed by different people. | [reply] |
by siracusa (Friar) on May 29, 2005 at 00:47 UTC | |
Do not use shift. Use @_. shift is slower, and Brian has an allergic reaction to it. I always use shift, and I recall benchmarking it way back in the day before I made that decision, just to make sure it wasn't slower. Here's the test I used, and the results:
Seeing the flat claim that shift is slower made me rethink my earlier test and try something more simple: Sure enough, the results changed, but now it appears to be a tie:
The results fluctuate a few percent in each direction. Anyway, my point is that I don't think performance is a reason to avoid using shift. (I have a whole directory of benchmarks for silly little things, e.g. benchmarking exists() vs. a test for truth on a hash key and crazy stuff like that. It's a disease...but it amuses me :-) | [reply] [d/l] [select] |
Re: I need perl coding standards
by Juerd (Abbot) on May 28, 2005 at 09:02 UTC | |
You don't *need* standards. However, when applied consistently, they can make things easier. I've listed my preferences at http://juerd.nl/perlstyle, in no particular order. Juerd # { site => 'juerd.nl', plp_site => 'plp.juerd.nl', do_not_use => 'spamtrap' } | [reply] |
Re: I need perl coding standards
by TheDamian (Vicar) on May 28, 2005 at 22:24 UTC | |
Perl Best Practices, by Damian Conway, O'Reilly, August 2005, 550pp, ISBN: 0-59600-173-8which offers a comprehensive coding standard (256 guidelines). I'll leave it to my fellow monks, several of whom have helped me fine-tune the book, to tell you whether or not it will be worth waiting two months, and then paying good money, for. ;-) | [reply] |
Re: I need perl coding standards
by stefp (Vicar) on May 29, 2005 at 01:21 UTC | |
This application is called perl_checker and is part of the perl-MDK-Common rpm. --
stefp | [reply] |
Re: I need perl coding standards
by planetscape (Chancellor) on Jun 20, 2005 at 18:16 UTC | |
An oldie but a goodie: Perl Style Guides for Large Projects
planetscape
| [reply] |