News for hackers. Stuff that matters.
Re:Perl as a career option by simcop2387 on Wednesday July 30, 2014 @03:13PM (#8110332)
You should also check out Moo[2] and Mouse[1]. They both try to be simpler versions of Moose without the compile-time (and runtime) performance issues of Moose. They do that by dropping some things like metaobject protocols and other things that are great for introspection but may not be something you really care too much about. They both try hard to keep syntactically the same as Moose when possible so that you can most of the time use them all interchangeably.

[1]http://search.cpan.org/~gfuji/Mouse-2.3.0/lib/Mouse.pm [2]http://search.cpan.org/~haarg/Moo-1.005000/lib/Moo.pm

Re:Perl as a career option by kbenson on Wednesday July 30, 2014 @07:33PM (#8111592)
Additionally, Moops[1] may be useful to get some extra sugar going. It's a meta module that includes a few other modules to give you a sane (Moose/Moo) object model, plus function and method signatures through Method::Signatures.

For example:

    use Moops;

    role NamedThing {
       has name => (is => "ro", isa => Str);
    }

    class Person with NamedThing;

    class Company with NamedThing;

    class Employee extends Person {
       has job_title => (is => "rwp", isa => Str);
       has employer  => (is => "rwp", isa => InstanceOf["Company"]);

       method change_job ( Object $employer, Str $title ) {
          $self->_set_job_title($title);
          $self->_set_employer($employer);
       }

       method promote ( Str $title ) {
          $self->_set_job_title($title);
       }
    }

[1] https://metacpan.org/pod/Moops