NAME
MooX::Keyword::Chain - Subroutine chains
VERSION
Version 0.02
SYNOPSIS
Quick summary of what the module does.
Perhaps a little code snippet.
package Chains;
use Moo;
use MooX::Keyword extends => '+Chain';
has boat => (
is => 'ro',
default => sub { [ ] }
);
chain add => 'politicians' => sub {
push @{ $_[0]->boat }, 'leadership';
};
chain add => 'reporters' => sub {
push @{ $_[0]->boat }, 'propaganda';
};
chain add => 'bankers' => sub {
push @{ $_[0]->boat }, 'finance';
};
1;
...
my $chains = Chains->new();
$chains->add(); # [ 'leadership', 'propaganda', 'finance' ];
DESCRIPTION
create a sub routine which chains from multiple other sub routines.
KEYWORDS
chain
Configure a chained sub routine.
chain two => 'demo' => sub {
...
}
chain two => 'show' => sub {
...
}
...
$chains->two(); # will call demo and then show
You can also still call each sub routine independently.
$chains->demo();
$chains->show();
AUTHOR
LNATION, <email at lnation.org>
BUGS
Please report any bugs or feature requests to bug-moox-keyword-chain at rt.cpan.org
, or through the web interface at https://rt.cpan.org/NoAuth/ReportBug.html?Queue=MooX-Keyword-Chain. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
SUPPORT
You can find documentation for this module with the perldoc command.
perldoc MooX::Keyword::Chain
You can also look for information at:
RT: CPAN's request tracker (report bugs here)
https://rt.cpan.org/NoAuth/Bugs.html?Dist=MooX-Keyword-Chain
CPAN Ratings
Search CPAN
ACKNOWLEDGEMENTS
LICENSE AND COPYRIGHT
This software is Copyright (c) 2023 by LNATION.
This is free software, licensed under:
The Artistic License 2.0 (GPL Compatible)