Well OK I see, you exit before CHECKs are executed and -c does all UNITCHECKs and CHECKs.

But please be aware that any BEGIN and UNITCHECK within a required module is executed, so you are only disabling CHECK and other UNITCHECKS on the top level script.

As I said, IMHO does Devel::TraceUse have the more flexible and extendable approach, because it catches all includes before they are done (and immediately printing a nested tree output)

You are parsing the (hopefully unmanipulated) entries from %INC at the top-level.

Both approaches have their pro and cons... :)

update

your approach is not much different from a source filter, so if you consider to release it as a use-able module you could implement it that way. But please be aware that both approaches have to deal with trailing __DATA__ and __END__ sections when appending (instead of prepending) a UNITCHECK.

Cheers Rolf

( addicted to the Perl Programming Language)


In reply to Re^5: Hacking Perl Code by LanX
in thread Hacking Perl Code by carlriz

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.