Perl::...lockMap(3pm)
β¨ NAME β¨
okay bestie, welcome to the <pink>Perl::...lockMap(3pm)</pink> page from the <purple>User Contributed Perl Documentation</purple>! π
The policy here is Perl::Critic::Policy::BuiltinFunctions::RequireBlockMap β it wants you to write map { /$pattern/ } @list instead of map /$pattern/, @list. That's the whole vibe. β¨
πΈ AFFILIATION πΈ
This Policy is part of the core Perl::Critic distribution. No cap, it ships with the core crew. π«Ά
π¦ DESCRIPTION π¦
The expression forms of grep and map are awkward and hard to read β they're lowkey giving "trying to decode a text from your ex" energy. Use the block forms instead. π
@matches = grep /pattern/, @list; #not ok
@matches = grep { /pattern/ } @list; #ok
@mapped = map transform($_), @list; #not ok
@mapped = map { transform($_) } @list; #ok
π CONFIGURATION π
This Policy is not configurable except for the standard options. That's it, bestie β no extra settings to hunt for. π
π₯ SEE ALSO π₯
Perl::Critic::Policy::BuiltinFunctions::ProhibitStringyEvalPerl::Critic::Policy::BuiltinFunctions::RequireBlockGrep
π AUTHOR π
Jeffrey Ryan Thalhammer <jeff@imaginative-software.com> β iconic author behavior. π
π COPYRIGHT π
Copyright (c) 2005-2013 Imaginative Software Systems. All rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The full text of this license can be found in the LICENSE file included with this module.
k bye bestie! π this little page is from <pink>perl v5.42.0</pink>, dated <purple>2024-10-23</purple>, and it's the <rainbow>Perl::...lockMap(3pm)</rainbow> manual β slay and goodbye! π
π¦ where this page comes from
- opensuse-leap 16.0: perl-Perl-Critic 1.156.0-bp160.1.1 Β· Artistic-1.0 OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms