NAME

MooX::Marlin - 🐮 ❤️ 🐟 inherit from Marlin classes in Moo

SYNOPSIS

use v5.20.0;
no warnings "experimental::signatures";

package Person {
  use Types::Common -lexical, -all;
  use Marlin::Util -lexical, -all;
  use Marlin
    'name'  => { is => ro, isa => Str, required => true },
    'age'   => { is => rw, isa => Int, predicate => true };
}

package Employee {
  use Moo;
  use MooX::Marlin;
  extends 'Person';
  
  has employee_id => ( is => 'ro', required => 1 );
}

WARNING

This appears to work, but it is not thoroughly tested.

DESCRIPTION

Loading this class will do a few things:

  • Ensures you are using at least Moo 2.004000 (released in April 2020).

  • Loop through all Marlin classes and roles which have already been defined (also any foreign classes like Class::Tiny ones which Marlin has learned about by inheritance, etc) and inject metadata about them into Moo's innards, enabling them to be used by Moo.

  • Tells Marlin to keep injecting metadata into Moo's innards for any Marlin classes or roles that are loaded later.

  • Checks that the caller package is a Moo class or Moo role, and complains otherwise. (Make sure to use Moo or use Moo::Role before you use Moo::Marlin!)

BUGS

Please report any bugs to https://github.com/tobyink/p5-marlin/issues.

SEE ALSO

Marlin, Moo.

AUTHOR

Toby Inkster <tobyink@cpan.org>.

COPYRIGHT AND LICENCE

This software is copyright (c) 2026 by Toby Inkster.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

DISCLAIMER OF WARRANTIES

THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.