Fancy::Map maps within a map.
This document describes Fancy::Map version 1.0.
my $colors = [fancy_map(
{ 'before' => 'glass', 'after' => 'beads' },
[map("sparkley $_", ('red', 'yellow', 'green', 'cyan', 'blue', 'magenta')), 'white', 'black', 'gray']
)];
[
'glass sparkley red beads',
'glass sparkley yellow beads',
'glass sparkley green beads',
'glass sparkley cyan beads',
'glass sparkley blue beads',
'glass sparkley magenta beads',
'glass white beads',
'glass black beads',
'glass gray beads'
];
fancy_map
can be exported and returns a list of mapped values from a list which already has a map in it. It takes three parameters. The first two are in a hash reference with the values to be mapped before and after the values of the list. The third is a reference to the list.
fancy_map( { 'before' => $before_value, 'after' => $after_value }, $list_with_a_map_in_it );
Fancy::Map depends on Exporter.
Lady Aleena
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic.
Copyright © 2020, Lady Aleena (aleena@cpan.org)
. All rights reserved.