[Koha-bugs] [Bug 22026] New: Remove `use Modern::Perl` from Koha::REST::classes

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Wed Dec 19 08:53:33 CET 2018


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22026

            Bug ID: 22026
           Summary: Remove `use  Modern::Perl` from Koha::REST::classes
 Change sponsored?: ---
           Product: Koha
           Version: master
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P5 - low
         Component: Architecture, internals, and plumbing
          Assignee: koha-bugs at lists.koha-community.org
          Reporter: martin.renvoize at ptfs-europe.com
        QA Contact: testopia at bugs.koha-community.org
  Target Milestone: ---

The REST api is based on Mojolicious and as such the controllers within this
namespace are all based upon `Mojo::Base`, `use Mojo::Base
'Mojolicious::Controller';` to be specific.

Mojo::Base enables the following, which are the only useful things achieved by
Modern::Perl in our case (as we limit ourselves to supporting perl 5.10, so any
and all other features past perl 5.10 are unavailable to use anyway).

```
use strict;
use warnings;
use utf8;
use feature ':5.10';
use mro;
use IO::Handle ();
require SomeBaseClass;
push @ISA, 'SomeBaseClass';
sub has { Mojo::Base::attr(__PACKAGE__, @_) }
```

As such, adding the `use Modern::Perl` statement is just noise and needlessly
loads a module.

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


More information about the Koha-bugs mailing list