http://www.perlmonks.org?node_id=324041


in reply to Re: Re: Debug code out of production systems
in thread Debug code out of production systems

Effort is spent compiling, that is thrown away later
Which is done in C. A source filter spents effort filtering - doing the work in Perl. Do you have any figures that show you have some form of "gain"?
Any BEGIN type code in there will have executed, so if you have a use in there, that module _will_ have been loaded.
Depends on how you write it.
use if 0, My::Module;
will not load My::Module.

Abigail

Replies are listed 'Best First'.
Re: Re: Debug code out of production systems
by liz (Monsignor) on Jan 26, 2004 at 08:20 UTC
    Do you have any figures that show you have some form of "gain"?

    No. I don't think there will be any chance of a gain until I rewrite the main conversion logic in XS. But I'm not in it for the gain of execution speed. I'm in it for the gain in the development cycle of a program.

    use if 0, My::Module

    Of course. But in that case I would prefer the idiom:

    if (CONSTANTTOBEFALSE) { require My::Module; }
    or, if execution of the import routine is necessary:
    if (CONSTANTTOBEFALSE) { require My::Module; My::Module->import; }

    I think that is much more descriptive of what is going on than the use of the if pragma.

    Liz