in reply to Re: Debug code out of production systems
in thread Debug code out of production systems
if (0) { use strict; } print "INC = @{[keys %INC]}\n"; __END__ INC = strict.pm
Furthermore, to activate sections of code, no changes would need to be made to the program. It's all external with my solution. With your solution, you would have to export constant subs to all namespaces, a not so easy task and a definite pollution of namespace. Even though the optimizer takes away sections of code, there remains a coderef to the original constant in the package namespace. See this example:
sub FALSE () { 0 } if (FALSE) { use strict; } print "INC = @{[keys %INC]}\n"; print "FALSE exists\n" if exists &FALSE; __END__ INC = strict.pm FALSE exists
Hope this explains some of the reasons I had for doing it the way I did.
Liz
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Debug code out of production systems
by Abigail-II (Bishop) on Jan 26, 2004 at 00:55 UTC | |
by liz (Monsignor) on Jan 26, 2004 at 08:20 UTC |