The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

SYNOPSIS

  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;

DESCRIPTION

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__, @_) }

SEE ALSO

Mojo::Base, Mojo::Base::XS.