Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/uasi/acme-then

The do-this-then-do-that utility
https://github.com/uasi/acme-then

Last synced: 17 days ago
JSON representation

The do-this-then-do-that utility

Awesome Lists containing this project

README

        

NAME
Acme::Then - The do-this-then-do-that utility

INSTALLATION
To install this module, run the following commands:

perl Makefile.PL
make
make test
make install

SYNOPSIS
Acme::Then::do {
...
} then {
...
LAST if ...;
} then {
...
};

You can turn a callback chain

do_something(cb => sub {
do_something(cb => sub {
do_something(cb => sub {
my ($res) = @_;
say $res;
});
});
});

into

Acme::Then::do {
do_something(cb => NEXT);
} then {
do_something(cb => NEXT);
} then {
do_something(cb => NEXT);
} then {
my ($res) = @_;
say $res;
};

DESCRIPTION
Do this, then do that.

FUNCTIONS
do
`do' {} then {};

then
do {} `then' {};

LAST
Exits from a do-then construct.

NEXT
Returns a coderef. The arguments to the coderef are set to the next
block's `@_'. The coderef should not be called more than once within the
same block.

AUTHOR
Tomoki Aonuma

LICENSE
This library is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.