While I agree with some of your points I don't believe hakkr was refering to code that is within other modules. (Like the Autoload example you gave) and I believe he means that HTML::Template should be used for HTML documents instead of adding tons of lines to a CGI program for the HTML. As one who has spent a lot of time using both, it makes lots of sense, separating HTML from the core CGI program make the code easier to understand and allows for designers that don't know a lick of Perl to play with the template files and add their prettyness to them.

Even though I agree I think that you are nitpicking at his idea rather than offering objective criticism. You try to refute some of his points without actually understanding them. Such as 32. Where code returns a result it should do so or die with a meaningful error and $!
I think that clearly states that rather than:

open(FILE,"$filename") or die $!;
He's saying that his programmers should put:
open(FILE,"$filename") or die "The file $filename couldn't be opened: +$!";

This make tons of sense! In a large program its helpful to see "foo.txt couldn't be opened: no such file or directory" rather than "no such file or directory", especially if you are opening more than one file.

My major complaint with your comment is your feeling about CPAN, he didn't say to never reinvent wheels, he said check CPAN first. Which is a very good idea. Frankly I'm not sure what CPAN you use, bad code usually gets marked as such and there are places to put test results if the code is failing. I use a lot of CPAN modules and normally the only reason one didn't work was because I didn't install it correctly. CPAN saves me tons of time.

I'm sorry but I had to mod you down for this comment. The tone is more "I don't do it this way, neither should you" which to me goes against the idea of Perl that you can do it any way you want to. I don't blame people for wanting programmers to follow a standard.

Chris

Lobster Aliens Are attacking the world!

In reply to Re: Re: Perl Programming guidlines/rules by cfreak
in thread Perl Programming guidelines/rules by hakkr

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.