The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

MooX::Keyword::Chain - Subroutine chains

VERSION

Version 1.00

SYNOPSIS

Quick summary of what the module does.

Perhaps a little code snippet.

        package Chains;

        use Moo;
        use MooX::Keyword extends => '+Chain';

        has items => (
                is => 'ro',
                default => sub { [ ] }
        );

        chain add => 'one' => sub {
                push @{ $_[0]->items }, 211;
        };

        chain add => 'two' => sub {
                push @{ $_[0]->items }, 19;
        };

        chain add => 'three' => sub {
                push @{ $_[0]->items }, 696;
        };

        1;

        ...

        my $chains = Chains->new();

        $chains->add(); # [ 211, 19, 696 ];

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:

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)