Perl::Critic:P:eProll:i:cCyr:i:tBUiuscie:lr:tPiConolFniutcnryci:tb:iuBotuneisdl:t:PiPenrrFoluhniDcboticituoCmnoesmn:pt:laPetrxioMohanipbpiitnCgosm(p3l)exMappings(3)



NNAAMMEE
       Perl::Critic::Policy::BuiltinFunctions::ProhibitComplexMappings - Map
       blocks should have a single statement.

AAFFFFIILLIIAATTIIOONN
       This Policy is part of the core Perl::Critic distribution.

DDEESSCCRRIIPPTTIIOONN
       The map function can be confusing to novices in the best of
       circumstances.  Mappings with multiple statements are even worse.
       They're also a maintainer's nightmare because any added complexity
       decreases readability precipitously.  Why?  Because map is
       traditionally a one-liner converting one array to another.  Trying to
       cram lots of functionality into a one-liner is a bad idea in general.

       The best solutions to a complex mapping are: 1) write a subroutine that
       performs the manipulation and call that from map; 2) rewrite the map as
       a for loop.

CCAAVVEEAATTSS
       This policy currently misses some compound statements inside of the
       map.  For example, the following code incorrectly does not trigger a
       violation:

           map { do { foo(); bar() } } @list

CCOONNFFIIGGUURRAATTIIOONN
       By default this policy flags any mappings with more than one statement.
       While we do not recommend it, you can increase this limit as follows in
       a _._p_e_r_l_c_r_i_t_i_c_r_c file:

           [BuiltinFunctions::ProhibitComplexMappings]
           max_statements = 2

AAUUTTHHOORR
       Chris Dolan <cdolan@cpan.org>

CCRREEDDIITTSS
       Initial development of this policy was supported by a grant from the
       Perl Foundation.

CCOOPPYYRRIIGGHHTT
       Copyright (c) 2007-2010 Chris Dolan.

       This program is free software; you can redistribute it and/or modify it
       under the same terms as Perl itself.



perl v5.12.2Perl::Critic::Policy::2B0u1i1l-t0i8n-F1u4nctions::ProhibitComplexMappings(3)
