in reply to Re^4: Hacking Perl Code
in thread Hacking Perl Code

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)

Replies are listed 'Best First'.
Re^6: Hacking Perl Code
by Discipulus (Canon) on Apr 09, 2014 at 19:39 UTC
    Thanks again LanX, you are becoming my teacher in elenctic method.. ;=)

    My attempt is only to show something i discovered and that fascinate me, as everytime with Perl. In a 'reinvent the wheel' style as a way to learn. As you can guess from my signature i would use Devel::TraceUse in a real project. Your comment are correct.

    I do not think to release something, may be usefull for me to investigate what a source filter is.

    When i was on my motorbike, 20 minutes after last post, i thought to the __DATA__ and __END__ side effect.

    See you at next question, i hope.

    L*
    There are no rules, there are no thumbs..
    Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.