That old code would be pretty easy to fix, if it only needs an 'use lenient;' option...

I never used strict when I started with perl (it made my code fail with a zillion error messages, quite depressing), until someone on this forum pointed out the benefits. I had to bite the bullet, I moved all my little scripts and cgi's over, and it has thought me to write much better perl code.

I don't exactly remember how long it took to switch, but I vividly remember how shocked I was about the number of bugs and typo's found. Unless you (OP) really, really know what you are doing and can give yourself a very good explanation of why using strict would only harm your program, you are probably better off to faithfully start writing your perl with strict, warnings and tainted.

Without strict, your code only looks as if it works. With strict, you get a very good indication that your code really does work (barring any logical errors or wrong conceptual ideas in your code ofcourse). As Jeffa said, use the seatbelt. Maybe it sets you back in a small number of cases (in some freak accidents people die because they were wearing a seatbelt, I've read), but there's no way you can balance it with the number of times it saves you. No matter how good you are; 4 o'clock at night and lack of caffeine is lethal to anybody's concentration and thus code.

So I like the idea of a default 'use strict;', so people who start with perl don't get the wrong idea about it being a frivolous extra like I did at first. 'use sloppy_programming;' should be an option, not the default.

Feel free to disagree, ofcourse.


In reply to Re: Re: Requiring use strict by december
in thread Requiring use strict by Wassercrats

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.