Syntax::Feature::Gather(3pm)

Syntax::Feature::Gather3pm

Provide a gather keyword

Usage

 use syntax 'gather';
 my @list = gather {
    # Try to extract odd numbers and odd number names...
    for (@data) {
       if (/(one|three|five|seven|nine)$/) { take qq{'$_'} }
       elsif (/^\d+$/ && $_ %2)            { take $_ }
    }
    # But use the default set if there aren't any of either...
    take @defaults unless gathered;
 }

or to use the stuff that Sub::Exporter gives us, try

 # this is a silly idea
 use syntax gather => {
   gather => { -as => 'bake' },
   take   => { -as => 'cake' },
 };
 my @vals = bake { cake (1...10) };

The full documentation for this module is in Syntax::Keyword::Gather. This is just a way to use the sugar that syntax gives us.

Version

version 1.001000

Authors

•

Arthur Axel "fREW" Schmidt <[email protected]>

•

Damian Conway

From libsyntax-keyword-gather-perl 1.001000-1 in Debian 7 (Wheezy). Parsed by carta from the page's man source.