Subject: Developers of Sympa
List archive
[sympa-developpers] painful warning about INIT block
- From: Guillaume Rousse <address@concealed>
- To: address@concealed
- Subject: [sympa-developpers] painful warning about INIT block
- Date: Wed, 04 Jun 2014 15:22:29 +0200
The usage of a INIT block in Sympa::Language triggers the following warning as soon as this package is imported at runtime (directly ou indirectly):
Too late to run INIT block at /home/guillaume/work/sympa/trunk/t/../src/lib/Sympa/Language.pm line 56.
Wouldn't running the same code in an import method, as in the following patch, be enough to achieve the same result, while fixing the issue ?
--
Guillaume Rousse
INRIA, Direction des systèmes d'information
Domaine de Voluceau
Rocquencourt - BP 105
78153 Le Chesnay
Tel: 01 39 63 58 31
Index: src/lib/Sympa/Language.pm
===================================================================
--- src/lib/Sympa/Language.pm (révision 10787)
+++ src/lib/Sympa/Language.pm (copie de travail)
@@ -50,7 +50,7 @@
Locale::Messages::bind_textdomain_codeset(web_help => 'utf-8');
}
-INIT {
+sub import {
## Initialize lang/locale.
SetLang('en');
}
Attachment:
smime.p7s
Description: Signature cryptographique S/MIME
-
[sympa-developpers] painful warning about INIT block,
Guillaume Rousse, 06/04/2014
-
Re: [sympa-developpers] painful warning about INIT block,
IKEDA Soji, 06/04/2014
- Re: [sympa-developpers] painful warning about INIT block, Guillaume Rousse, 06/04/2014
-
Re: [sympa-developpers] painful warning about INIT block,
IKEDA Soji, 06/04/2014
Archive powered by MHonArc 2.6.19+.