map
s with complex bodies would be good. If you have one or more such beasts, would you leave a comment with them?The talk will be given at The Pittsburgh Perl Workshop.
map
s with complex bodies would be good. If you have one or more such beasts, would you leave a comment with them?
From Perl::Dist::WiX::BuildPerl::_get_cpan_upgrades_list (you can get a properly indented version there, the first few lines are context):
ReplyDeletemy @modulelist = CPAN::Shell->expand('Module', '/./');
# Schwartzian transform from CPAN.pm.
my @expand;
@expand = map {
$_->[1]
} sort {
$b->[0] <=> $a->[0]
||
$a->[1]{ID} cmp $b->[1]{ID},
} map {
[$_->_is_representative_module,
$_
]
} @modulelist;
Web::Simple's Web::Simple::DispatchParser::_parse_spec has some good tricks like do{} blocks, hash slices, push-ors, and other niceties. It was created by mst for the "Antiquated Perl" talk, after all..
ReplyDelete