PMLTQ::Base - Base class for PMLTQ inspired by Mojo::Base and Mojo::Base::XS
version 1.5.0
package Cat; use PMLTQ::Base -base; has name => 'Nyan'; has [qw(age weight)] => 4; package Tiger; use PMLTQ::Base 'Cat'; has friend => sub { Cat->new }; has stripes => 42; package main; use PMLTQ::Base -strict; my $mew = Cat->new(name => 'Longcat'); say $mew->age; say $mew->age(3)->weight(5)->age;
PMLTQ::Base is a simple base class for PMLTQ project. It works the same way as Mojo::Base. The following is taken from Mojo::Base documentation:
# Automatically enables "strict", "warnings", "utf8" and Perl 5.10 features use PMLTQ::Base -strict; use PMLTQ::Base -base; use PMLTQ::Base 'SomeBaseClass';
All three forms save a lot of typing.
# use PMLTQ::Base -strict; use strict; use warnings; use utf8; use feature ':5.10'; use IO::Handle (); # use PMLTQ::Base -base; use strict; use warnings; use utf8; use feature ':5.10'; use IO::Handle (); use PMLTQ::Base; push @ISA, 'PMLTQ::Base'; sub has { PMLTQ::Base::attr(__PACKAGE__, @_) } # use PMLTQ::Base 'SomeBaseClass'; use strict; use warnings; use utf8; use feature ':5.10'; use IO::Handle (); require SomeBaseClass; push @ISA, 'SomeBaseClass'; use Mojo::Base; sub has { Mojo::Base::attr(__PACKAGE__, @_) }
Mojo::Base, Mojo::Base::XS.
Petr Pajas <pajas@ufal.mff.cuni.cz>
Jan Štěpánek <stepanek@ufal.mff.cuni.cz>
Michal Sedlák <sedlak@ufal.mff.cuni.cz>
Matyáš Kopp <matyas.kopp@gmail.com>
This software is copyright (c) 2015 by Institute of Formal and Applied Linguistics (http://ufal.mff.cuni.cz).
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install PMLTQ, copy and paste the appropriate command in to your terminal.
cpanm
cpanm PMLTQ
CPAN shell
perl -MCPAN -e shell install PMLTQ
For more information on module installation, please visit the detailed CPAN module installation guide.