I can't make up my mind when it comes to ++ing or --ing this node, so I'll leave it as a no-vote and be content with that method :) Now on to my comments:

How important are all of the standard coding-rules that get mentioned in just about every thread here?

They must be pretty important if nearly every thread mentions them. That just makes pure sense, does it not?

use CGI.pm!

CGI::Simple is also a great candidate, it's what I now use with all my CGI scripts. No more CGI.pm for me. If you are planning on accepting any user input or printing out http headers (I hope you do headers :P), one of the modules that have withstood the tests of time is a must.

use strict! use warnings!

I'm not sure what to say to this. Warnings and strict are a part of every single script I write, with the exception of shell one-liners. Not to use these pragmas just seems wrong to me.

use placeholders!

Placeholders are heavenly. Whenever database management is introduced into a project, placeholders become a necessity for me. I always use them, they save a lot of hassle!

use OO!

Nah. As already stated, OO is just for organization and for making hard work behind the scenes appear easy. OO is a wonderful tool with awesome powers, but it is not always needed to complete a good project.

use templates!

Templating systems are fantastic and should really be used within any major project. There are cases where using a templating system is overkill, so exceptions do exist. For the rest of the time, separating code from interface text makes for good programming practice. It looks neater, it's much better organized and the logic flows nicely.

use CGI::Application!

I admit to having never used this module. I just do it my own way, which is very concise and clear:

#!c:/perl/bin/perl -w $|++; use strict; use CGI::Simple; my $nodes = { index => \&main_index, links => \&show_links, shop => \&shopping, _err => \&invalid_node }; my $node = $q->param('node') || 'index'; $nodes->{ exists $nodes->{$node} ? $node : '_err' }->(); sub main_index { } sub show_links { } sub shopping { } sub invalid_node { }

I know that each and every single one of these dogmas has its very good reasons, can boost efficiency, improve maintainability, lets you get 'run over by a bus' without anybody caring too much, make you more lazy, increase your hubris and presumably even lower your cholestorol.

Bravo, you just explained why yourself :)


In reply to Re: Perlmonk's "best pratices" in the real world by Coruscate
in thread Perlmonk's "best pratices" in the real world by schweini

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.