Perl::ToPerl6::Transformer::CompoundStatements::RewriteMapGreps - Format map{}, grep{}
This Transformer is part of the core Perl::ToPerl6 distribution.
Perl6 unifies map{} and grep{} with the rest of the function calls, in that the first argument must be a block, and the arguments must be separated with commas. This transformer adds the block where needed, and inserts the comma as required:
map{}
grep{}
map {$_++} @x; --> map {$_++}, @x; map /x/ @x; --> map {/x/}, @x; grep {$_++} @x; --> grep {$_++}, @x; grep /x/ @x; --> grep {/x/}, @x;
This Transformer is not configurable except for the standard options.
Jeffrey Goff <drforr@pobox.com>
Copyright (c) 2015 Jeffrey Goff
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Perl::ToPerl6, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Perl::ToPerl6
CPAN shell
perl -MCPAN -e shell install Perl::ToPerl6
For more information on module installation, please visit the detailed CPAN module installation guide.