Stas Bekman <[EMAIL PROTECTED]> writes:

> > You can have the checks in during development, and pull during
> > production.  It's not 100% efficient, but it's pretty close.  With
> > some use constant magic, you may even be able to get the compiler to
> > optimize away the entire line at compile time, resulting not even in a
> > check on the value of $DEBUG in production environments.
> 
> which is true only if it's:
> 
> use constant DEBUG => 1;
> 
> and not:
> 
> $DEBUG = 1;

Right; hence my veiled reference to 'use constant' magic :)

> Basically you should be able to turn the development checking at compile
> time for the whole project via startup.pl:
> 
> use My::Init qw(PRODUCTION);
> vs.
> use My::Init qw(DEVELOPMENT);

I like this method of turning debug on and off.  Hadn't seen this
novel method, but it has a nice feel to it.

> To conclude, if you make all your checkings/validations only in debug
> version it doesn't matter how fast or slow they are. I think what matters
> here is the clearness of the code.

I agree 100%.

Chip

-- 
Chip Turner                   [EMAIL PROTECTED]
                              RHN Web Engineer

Reply via email to