[Koha-bugs] [Bug 14066] Koha code does not really use Readonly

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Mon Apr 27 17:09:13 CEST 2015


http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14066

--- Comment #3 from M. Tompsett <mtompset at hotmail.com> ---
Comment on attachment 38546
  --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=38546
Bug 14066: Remove the Readonly[::XS] dependency

Review of attachment 38546:
 --> (http://bugs.koha-community.org/bugzilla3/page.cgi?id=splinter.html&bug=14066&attachment=38546)
-----------------------------------------------------------------

::: C4/Installer/PerlDependencies.pm
@@ -240,5 @@
> -    'Readonly' => {
> -        'usage'    => 'Core',
> -        'required' => '1',
> -        'min_ver'  => '1.03'
> -    },

I think we should keep Readonly. It is one of the better ways of defining
constants, and would allow us to improve our perlcritic levels in the future.
Currently, we only require perlcritic -5.

@@ -245,5 @@
> -    'Readonly::XS' => {
> -        'usage'    => 'Core',
> -        'required' => '0',
> -        'min_ver'  => '1.02'
> -    },

However, from the Readonly page on CPAN:
"I repeat, you do not need Readonly::XS if your environment has perl 5.8.x or
higher."
Perhaps just removing Readonly::XS is the better solution. :)

::: Koha/Calendar.pm
@@ +126,4 @@
>  
>      if ( $unit eq 'hours' ) {
>          # Fixed for legacy support. Should be set as a branch parameter
> +        my $return_by_hour => 10;

Readonly's definition of a scalar value is confusing, such that when you
changed it to a simple variable to accidentally left what looks like hashiness
(=>), even though it probably should be plainly scalar (=).

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list