A month or so ago, I replied to Implementing strict on shoddy code with a potential solution to adding strict piecemeal by using requires.(Re: Re:(2501- further clarification) Implementing strict on shoddy code) In short, I found that if I use strict in one script, and then require a separate one, strict does not carry over, other than hiding the variables of the parent script.

My question now is whether writing my new code inside a required script using strict is a valid solution to slowly bringing everything into using strict?

I am currently in a situation where I am working on a large project (20,000+) lines of code. This code, after it's release, will be a continual evolution of bug fixes and added features. None of the code uses strict, as of yet. As I am now adding additional functionality, I have the opportunity to use strict on anything I write, and potentially correct some of the other code as time permits. Because of the amount of preexisting code, and time constraints, I cannot just drop use strict at the top and hope to finish anywhere near the deadline.

Thanks for your help

In reply to Partial strict using require by dfog

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.