From: Rafael Garcia-Suarez <[EMAIL PROTECTED]>
> Rodent Of Unusual Size wrote in perl.module-authors :
> > 
> > i want to be able to define 'constants' in a module at run time,
> > rather than at compile time.  'use constant' does it too early.
> 
> This is an oxymoron. If your constants change at run time, they're not
> constant anymore, are they ?

What if they are set up during the script's startup and then stay 
constant? Then they were changed (well defined) once during one of 
the several "runtimes" but still they are constant for the rest of 
the script and may even be treated as constants by the optimizer. If 
it's done right.

Eg. Win32::Daemon::Simple reads some params from the registry and 
defines some constants within the import() subroutine. So for the 
script using the module these are constants and can be optimized into 
the values, yet the values were loaded from outside "at runtime".

Jenda
===== [EMAIL PROTECTED] === http://Jenda.Krynicky.cz =====
When it comes to wine, women and song, wizards are allowed 
to get drunk and croon as much as they like.
        -- Terry Pratchett in Sourcery

Reply via email to