Perl::Critic::Policy::BuiltinFunctions::ProhibitComplexMappings man page on Fedora

Man page or keyword search:  
man Server   31170 pages
apropos Keyword Search (all sections)
Output format
Fedora logo
[printable version]

Perl::CriticPerl::Critic::Policy::BuiltinFunctions::ProhibitComplexMappings(3)

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

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

DESCRIPTION
       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.

CAVEATS
       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

CONFIGURATION
       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 .perlcriticrc file:

	   [BuiltinFunctions::ProhibitComplexMappings]
	   max_statements = 2

AUTHOR
       Chris Dolan <cdolan@cpan.org>

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

COPYRIGHT
       Copyright (c) 2007-2011 Chris Dolan.

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

perl v5.14.1Perl::Critic::Policy::BuiltinFunctions::ProhibitComplexMappings(3)
[top]

List of man pages available for Fedora

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net