Hi, On Jan 21, 2012, at 11:40 PM, Chris Cormack wrote:
* Mason James (mtj@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@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