Perl6::Take - gather/take in Perl 5


Perl6-Take documentation  | view source Contained in the Perl6-Take distribution.

Index


NAME

Top

Perl6::Take - gather/take in Perl 5

SYNOPSIS

Top

    use Perl6::Take;

    my @foo = gather {
        take 5;
    };

EXPORT

Top

gather

Accepts a block. take statements inside the dynamic scope of the block are used to accumulate a list, which is gathered as the return value of the block.

take

Accumulates its argument (or list of arguments) on to the nearest gather in the dynamic scope. Arguments are evaluated in list context. The arguments may be passed on to a variable, but note that this assignment should usually be done in list context, as per usual context rules:

    $answer   = take 42; #  1
    ($answer) = take 42; # 42

AUTHOR

Top

Gaal Yahas, <gaal at forum2.org>

BUGS

Top

Please report any bugs or feature requests to bug-perl6-gather at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Perl6-Take. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

Top

You can find documentation for this module with the perldoc command.

    perldoc Perl6::Take

You can also look for information at:

* AnnoCPAN: Annotated CPAN documentation

http://annocpan.org/dist/Perl6-Take

* CPAN Ratings

http://cpanratings.perl.org/d/Perl6-Take

* RT: CPAN's request tracker

http://rt.cpan.org/NoAuth/Bugs.html?Dist=Perl6-Take

* Search CPAN

http://search.cpan.org/dist/Perl6-Take

ACKNOWLEDGEMENTS

Top

COPYRIGHT (The "MIT" License)

Top


Perl6-Take documentation  | view source Contained in the Perl6-Take distribution.