Spot-on. I've got a number of modules which contain sub-routines that are called, including calls to and from other sub-routines in other modules.

The one causing the problem is recursive and calls itself to fill an array with all the files found in a directory tree. Calling that sub-routine from another module is where I ran into the printing oddity ( odd to me ) when testing it out.

I'm still fuzzy on the evaluation part. I had thought that the evaluation was just checking the script for syntax and reference errors - essentially, "static" script problems. I didn't think the evaluation also includes running the sub-routines to check for run-time errors.

Is that what actually happens - that Perl does a "test-run" of the sub-routines in addition to checking for syntax and reference errors ?


In reply to Re^2: sub running on use statement by Anonymous Monk
in thread sub running on use statement by Anonymous Monk

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.