<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body>A new request with request id 17803 has been created by koha-devel-request@lists.koha-community.org. Short info on the request is : <br><br>Title : Koha-devel Digest, Vol 187, Issue 11<br>Category : <br>Description : <div>Send Koha-devel mailing list submissions to<br>    koha-devel@lists.koha-community.org<br><br>To subscribe or unsubscribe via the World Wide Web, visit<br>    https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel<br>or, via email, send a message with subject or body 'help' to<br>    koha-devel-request@lists.koha-community.org<br><br>You can reach the person managing the list at<br>    koha-devel-owner@lists.koha-community.org<br><br>When replying, please edit your Subject line so it is more specific<br>than "Re: Contents of Koha-devel digest..."<br><br><br>Today's Topics:<br><br>   1. Re: Perl syntax for strings (Thomas Klausner)<br>   2. Re: some thoughts on #28519 regarding lib (Jonathan Druart)<br><br><br>----------------------------------------------------------------------<br><br>Message: 1<br>Date: Tue, 15 Jun 2021 11:00:38 +0200<br>From: Thomas Klausner <domm@plix.at><br>To: koha-devel@lists.koha-community.org<br>Subject: Re: [Koha-devel] Perl syntax for strings<br>Message-ID: <YMhsNoJn6AUMfTsP@plix.at><br>Content-Type: text/plain; charset=us-ascii<br><br>Hi!<br><br>On Tue, Jun 15, 2021 at 10:19:12AM +0200, Fridolin SOMERS wrote:<br> <br>> I see in Perl code some cases where a string in written with a space between<br>> q or qq or qw and string.<br>> Like : qq /foo bar/ instead of qq/foo bar/<br><br>While this works, it is strongly recommended to not use this "feature". <br>It's main "use" is to use ANY string as quote-like operator:<br><br>perl -E 'say qq A({/";A'<br>({/";<br><br>But of course this is horrible and should not be used (outside of <br>obfuscations..)<br><br>> Most of cases are in :<br>>   use CGI qw ( -utf8 );<br><br>This isn't even using the "feature" to allow any string..<br><br>> There are only 29 other cases :<br>>   git grep -E ' q[qw]? [/({]' | grep -v 'use CGI qw '<br><br>Of course this regex would fail to find why the space after q/qq/qw is <br>allowed, because using the space you can use ANY char for the quote-like <br>op. But I'm quite sure that nobody is crazy enough to put that into <br>production code. And coming up with a regex that matches this would be <br>quite hard... Though maybe there is a Perl::Critic rule for it?<br><br>> Should we add a coding guideline ?<br>> https://wiki.koha-community.org/wiki/Coding_Guidelines<br><br>++<br><br>Greetings,<br>domm<br><br>-- <br>#!/usr/bin/perl                             https://domm.plix.at<br>for(ref bless{},just'another'perl'hacker){s-:+-$"-g&&print$_.$/}<br><br><br>------------------------------<br><br>Message: 2<br>Date: Tue, 15 Jun 2021 11:26:18 +0200<br>From: Jonathan Druart <jonathan.druart@bugs.koha-community.org><br>To: koha-devel <koha-devel@lists.koha-community.org><br>Subject: Re: [Koha-devel] some thoughts on #28519 regarding lib<br>Message-ID:<br>    <CAJzKNY5LN74QHOB3cXM-q8HTa=4QDU3pBG1dck6vNwS9HC2j6A@mail.gmail.com><br>Content-Type: text/plain; charset="UTF-8"<br><br>Hi Thomas,<br><br>I've sent the following notes to the QA team, but maybe it needed to be public.<br>The history behind 28519 is not trivial :)<br><br>"""<br>To clarify and explain a bit more what we are doing here (to those<br>outside of the loop):<br>- We switched from YAML[::Syck] to YAML::XS (22824, 27673)<br>- We had to replace the YAML serializer provided by CGI::Session (no<br>YAML::XS serializer exists in cpan).<br>- We decided to switch back to the default serializer (using<br>Data::Dumper), which we used a looong time ago in Koha already, but<br>faced... encoding problems. However we couldn't replicate them and<br>thought we were safe (28317).<br>- 21.05.00 is released and we discover a bug (28489), there is an<br>encoding issue caused by Data::Dumper (and more precisely its C<br>implementation, see bug 28489 comment 13 for more info). To add to the<br>confusion: the bug appears only if strict_sql_modes is on.<br>- We need a fix for 21.05.01!<br>- There are several options we investigate on Friday, lot seems to be<br>working but few really work:<br>  * $Data::Dumper::Useperl=1 (maybe)<br>  * Reintroduce YAML::Syck and get back to CGI::Session::Serializer::YAML<br>  * Use our own YAML::XS serializer (which has been suggested when we<br>moved to Data::Dumper already)<br>We decided to go with the latter and Andrew wrote a patch. A bit hacky<br>as the Serializer::yamlxs code was inside C4::Auth. David wrote a<br>follow-up (28519) to clean it and move the code to a separate file.<br><br>What's next?<br>- We need 28489 for 21.05.01<br>- Ideally we need 28519 as well!<br>- We should move to Data::Session and decide on the JSON serializer or<br>write our YAML::XS serializer for Data::Session (17427)<br>"""<br><br>We actually need CGI::Session::Serializer::yamlxs, not CGI::Session<br>(we are still installing it from the debian package).<br><br>Hope that clarifies<br>Cheers,<br>Jonathan<br><br>Le mar. 15 juin 2021 à 10:48, Thomas Klausner <domm@plix.at> a écrit :<br>><br>> Hi!<br>><br>> without knowing a lot of Koha-internals (still..), I'd strongly prefer<br>> to have all the code in a lib dir (as is standard in Perl apps / modules<br>> for ages).<br>><br>> There are also a lot of tools available to make using code stored `lib`<br>> (but not "installed" in the system, i.e. only available in the checkout)<br>> easy. The simplest is of course 'lib': https://perldoc.perl.org/lib<br>><br>> Or more complex like https://metacpan.org/pod/lib::projectroot (which I<br>> wrote some time ago to handle a Monorepo setup; it also includes a<br>> comparison of different modules in the SEE ALSO section)<br>><br>> OTOH, CGI::Session::Serialize is a cpan module, so technically it should<br>> not be checked out into the app code `lib`, but installed as a<br>> dependency. There are even more ways to handle installing of<br>> dependencies and the finding them, but the currently most comfortable<br>> one is https://metacpan.org/pod/Carton. Or (if running everything via<br>> Carton is too much of a change), a combination of<br>> https://metacpan.org/pod/local::lib and a modern CPAN client<br>> (https://metacpan.org/pod/App::cpanminus or<br>> https://metacpan.org/pod/App::cpm.<br>><br>> I did not want to spam the actuall ticket with this, as I'm not sure if<br>> any of this is in fact relevant to the bug, and/or matches the current<br>> plans for Koha.<br>><br>> Greetings,<br>> domm<br>><br>><br>> --<br>> #!/usr/bin/perl                             https://domm.plix.at<br>> for(ref bless{},just'another'perl'hacker){s-:+-$"-g&&print$_.$/}<br>> _______________________________________________<br>> Koha-devel mailing list<br>> Koha-devel@lists.koha-community.org<br>> https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel<br>> website : https://www.koha-community.org/<br>> git : https://git.koha-community.org/<br>> bugs : https://bugs.koha-community.org/<br><br><br>------------------------------<br><br>Subject: Digest Footer<br><br>_______________________________________________<br>Koha-devel mailing list<br>Koha-devel@lists.koha-community.org<br>https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel<br>website : https://www.koha-community.org/<br>git : https://git.koha-community.org/<br>bugs : https://bugs.koha-community.org/<br><br><br>------------------------------<br><br>End of Koha-devel Digest, Vol 187, Issue 11<br>*******************************************<br></div><br><br>NOTE: You are receiving this mail because, the Requester/Technician wanted you to get notified on this request creation.<br></body></html>