<div dir="ltr"><div>"At some point", yes...</div><div><div class="inbox-inbox-knob-buttons">
      </div>
     <a href="https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8244"><b>Bug 8244</b></a> <span id="inbox-inbox-summary_container">
      - <span id="inbox-inbox-short_desc_nonedit_display">Script to find exporter problems</span></span></div><div><div class="inbox-inbox-knob-buttons">
      </div>
     <a href="https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17600"><b>Bug 17600</b></a> <span id="inbox-inbox-summary_container">
      - <span id="inbox-inbox-short_desc_nonedit_display">Standardize the EXPORT</span></span></div></div><br><div class="gmail_quote"><div dir="ltr">On Wed, 24 Oct 2018 at 20:24 David Cook <<a href="mailto:dcook@prosentient.com.au">dcook@prosentient.com.au</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Whether or not to prefix the function with "C4::Accounts::" is something we should probably talk about at some point. <br>
<br>
Historically, a lot of Koha modules use the "Exporter" module to export their functions into the main namespace of the caller. When "use C4::Accounts" runs, it automatically calls the "import" function in C4::Accounts, which in most/all cases is provided by the Exporter module. Blah blah blah. You can use the syntax "use C4::Accounts qw()" to prevent the importing of any functions or you can selectively import functions with "use C4::Accounts qw(function1 function2)". Fun times...<br>
<br>
If you don't automatically import functions into the main namespace of the caller, then you'd want to definitely prefix the function with C4::Accounts::, otherwise you'll get an error since that function would be declared in the main namespace (or worse it's the same function name and you wind up with more errors/unexpected behaviour). <br>
<br>
Personally, I rather use object oriented programming like we're trying in the Koha:: modules and/or have function libraries that don't use Exporter and instead require use of full namespace (e.g. C4::Accounts::function1). I think that's just a lot more transparent. More verbose but more explicit and easier to understand. Also fewer changes of function name collisions and less messy main namespace in the caller. <br>
<br>
That's my 2 cents. <br>
<br>
David Cook<br>
Systems Librarian<br>
Prosentient Systems<br>
72/330 Wattle St<br>
Ultimo, NSW 2007<br>
Australia<br>
<br>
Office: <a href="tel:02%2092%2012%2008%2099" value="+33292120899" target="_blank">02 9212 0899</a><br>
Direct: <a href="tel:02%2080%2005%2005%2095" value="+33280050595" target="_blank">02 8005 0595</a><br>
<br>
-----Original Message-----<br>
From: <a href="mailto:koha-devel-bounces@lists.koha-community.org" target="_blank">koha-devel-bounces@lists.koha-community.org</a> [mailto:<a href="mailto:koha-devel-bounces@lists.koha-community.org" target="_blank">koha-devel-bounces@lists.koha-community.org</a>] On Behalf Of Mark Tompsett<br>
Sent: Thursday, 25 October 2018 3:43 AM<br>
To: Koha-devel <<a href="mailto:koha-devel@lists.koha-community.org" target="_blank">koha-devel@lists.koha-community.org</a>><br>
Subject: [Koha-devel] The order of "use"<br>
<br>
Greetings,<br>
<br>
I was looking at bug 21641, and noticed the patch was explicitly stating<br>
C4::Accounts:: on the function in question. I vaguely recalled this sort of symptom shows itself in a knotted “use” mess.<br>
<br>
C4::Circulation –> C4::Members –> C4::Accounts C4::Circulation –> C4::Accounts C4::Circulation –> C4::Overdues –> C4::Accounts<br>
<br>
What is the best order to list these? C4::Accounts last?<br>
Is putting the C4::Accounts:: on the function in question still something we should do anyways?<br>
<br>
Feedback appreciated,<br>
Mark Tompsett <br>
<br>
_______________________________________________<br>
Koha-devel mailing list<br>
<a href="mailto:Koha-devel@lists.koha-community.org" target="_blank">Koha-devel@lists.koha-community.org</a><br>
<a href="http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel" rel="noreferrer" target="_blank">http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel</a><br>
website : <a href="http://www.koha-community.org/" rel="noreferrer" target="_blank">http://www.koha-community.org/</a> git : <a href="http://git.koha-community.org/" rel="noreferrer" target="_blank">http://git.koha-community.org/</a> bugs : <a href="http://bugs.koha-community.org/" rel="noreferrer" target="_blank">http://bugs.koha-community.org/</a><br>
<br>
<br>
_______________________________________________<br>
Koha-devel mailing list<br>
<a href="mailto:Koha-devel@lists.koha-community.org" target="_blank">Koha-devel@lists.koha-community.org</a><br>
<a href="http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel" rel="noreferrer" target="_blank">http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel</a><br>
website : <a href="http://www.koha-community.org/" rel="noreferrer" target="_blank">http://www.koha-community.org/</a><br>
git : <a href="http://git.koha-community.org/" rel="noreferrer" target="_blank">http://git.koha-community.org/</a><br>
bugs : <a href="http://bugs.koha-community.org/" rel="noreferrer" target="_blank">http://bugs.koha-community.org/</a></blockquote></div>