In attempts in learning to use strict, I came across an odd phenominon that may help in this situation. I have a controlling file using many different requires as the situation demands. Adding use strict to one of the requires returned the usual strict errors for the file required, but not for the controller or any other files required. This occured using ActivePerl Build 618 (Perl 5.6) running on a Win2K box. Using this, so long as one's software is broken down into manageable subroutines, as needed each one can be moved into a file with use strict and required. The subroutine can then be made strict, leaving the rest still in it's original state. To test this, I used the following code :
Controller -- #!perl $x = 5; print "Before Require $x\n"; require('e:/perltest/require.cgi'); &MoreTest; sub MoreTest { $y = 6; print "After Require $x, $y\n"; &TestPrint(); print "After TestPrint $x, $y, $z"; } REQUIRE -- #!perl use strict; print "In Require\n"; sub TestPrint { my $z = 10; # print "$x $y "; print "$z\n"; } 1;
If you uncomment the print statement in TestPrint in the require, you will get the strict errors, while the in the controller, you see the vars $w and $z are not defined yet still recieve no errors. I hope this information helps Dave

In reply to Re: Re:(2501- further clarification) Implementing strict on shoddy code by dfog
in thread Implementing strict on shoddy code by 2501

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.