[Koha-devel] add the Smart::Comments perl module to Koha, a good idea?

Galen Charlton gmc at esilibrary.com
Sun Jan 22 22:40:07 CET 2012


Hi,

On Jan 21, 2012, at 11:40 PM, Chris Cormack wrote:
> * Mason James (mtj at kohaaloha.com) wrote:
>> hmmm, shall we start wrapping the loading of Koha debug modules in a 'if ($DEBUG) {use Smart::Comments}' type code block - as a performance tweak?
>> 
>> 
>> would that work?
> 
> No because the use is called anyway, you can conditionally use a use
> call. You would need to do require and import.

_Cannot_ conditionally use a use call, I assume. 

Mason: "use Foo;" is equivalent to

BEGIN {
   require Foo;
   import Foo;
};

The implicit BEGIN block is why one can put a use call anywhere in the source file, including after code that makes use of the module one is use'ing.

Regards,

Galen
--
Galen Charlton
Director of Support and Implementation
Equinox Software, Inc. / The Open Source Experts
email:  gmc at esilibrary.com
direct: +1 770-709-5581
cell:   +1 404-984-4366
skype:  gmcharlt
web:    http://www.esilibrary.com/
Supporting Koha and Evergreen: http://koha-community.org & http://evergreen-ils.org



More information about the Koha-devel mailing list