As the given/when keywords now generate errors in current perl and their future behaviour is subject to change. Remove them from Dateutils which generates errors in all code using it
Created attachment 23894 [details] [review] Proposed Patch To test compile using a perl version 5.18 or greater without patch warnings are generated for given and when in this module. With patch these warnings no longer occur. See perldelta for 5.18 for details on the change in perl's behaviour
Created attachment 23905 [details] [review] Bug 11468 Remove given when from Koha::Dateutils given and when give warnings due to their experimental status as of perl 5.18. Replace the construct with an if/elsif to avoid the keywords Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Created attachment 23914 [details] [review] [PASSED QA] Bug 11468 Remove given when from Koha::Dateutils given and when give warnings due to their experimental status as of perl 5.18. Replace the construct with an if/elsif to avoid the keywords Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> Passes all tests and QA script, especially t/DateUtils.t.
Pushed to master. Thanks, Colin!
Should the use of given/when be avoided ? If yes it may be added to http://wiki.koha-community.org/wiki/Coding_Guidelines
(In reply to Fridolin SOMERS from comment #5) > Should the use of given/when be avoided ? > If yes it may be added to > http://wiki.koha-community.org/wiki/Coding_Guidelines I think so This is the perldelta for 5.18 : The smartmatch family of features are now experimental Smart match, added in v5.10.0 and significantly revised in v5.10.1, has been a regular point of complaint. Although there are a number of ways in which it is useful, it has also proven problematic and confusing for both users and implementors of Perl. There have been a number of proposals on how to best address the problem. It is clear that smartmatch is almost certainly either going to change or go away in the future. Relying on its current behavior is not recommended. Warnings will now be issued when the parser sees "~~", "given", or "when". To disable these warnings, you can add this line to the appropriate scope: no if $] >= 5.018, warnings => "experimental::smartmatch"; Consider, though, replacing the use of these features, as they may change behavior again before becoming stable.
Pushed to 3.14.x, will be in 3.14.10
Picked for 3.12.15!