in reply to evil code of the day: global stricture control

strict.pm contains about a dozen lines of executable code, none of which does anything particularly expensive. Is there some reason you consider that tiny bit of code a big enough deal to try to eliminate? It seems like micro-optimization to me, something unlikely to be worth doing.

But your problem is easy to solve:

BEGIN { strict->import( ... ) if $INC{"strict.pm"} }

- tye        

Replies are listed 'Best First'.
Re^2: evil code of the day: global stricture control (micro)
by ysth (Canon) on Aug 02, 2007 at 08:20 UTC
    I did say "evil". I was expecting someone would propose your code (only it needs to be "strict"->import if strict is not loaded); also $ENV{TESTING} or some such instead of $INC{"strict.pm"}.
    Is there some reason you consider that tiny bit of code a big enough deal to try to eliminate?
    It wasn't me considering it: http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2007-08/msg00055.html (the >>'d text is not Max).