Mus - Mu but with slightly more typing and strict constructors
package Foo; use Mus; ro "hro"; lazy hlazy => sub { 2 }; rwp "hrwp"; rw "hrw"; my $foo = Foo->new(i_don_exist => 5, hro => "exists", hrwp => "exists", hrw => "exists"); # Found unknown attribute(s) passed to the constructor: i_dont_exist at (eval 30) line 52. # Foo::new("Foo", "i_dont_exist", 5, "hro", "exists", "hrwp", "exists", "hrw", ...) called at Foo.pl line 9
Mus imports both Mu and MooX::StrictConstructor making it even less work in typing and reading to set up an object with a strict constructor.
Mu::Role should still be used for roles, as strict constructors don't apply to roles, so I did not duplicate this.
Adam Hopkins <srchulo@cpan.org>
Copyright 2019- Adam Hopkins
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Mu
MooX::StrictConstructor
To install Mus, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Mus
CPAN shell
perl -MCPAN -e shell install Mus
For more information on module installation, please visit the detailed CPAN module installation guide.