Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

perl::critic::policy::subroutines::prohibitbuiltinhomonyms(3) [centos man page]

Perl::Critic::Policy::Subroutines::ProhibitBuiltinHomonyUser)Contributed Perl DocumenPerl::Critic::Policy::Subroutines::ProhibitBuiltinHomonyms(3)

NAME
Perl::Critic::Policy::Subroutines::ProhibitBuiltinHomonyms - Don't declare your own "open" function. AFFILIATION
This Policy is part of the core Perl::Critic distribution. DESCRIPTION
Common sense dictates that you shouldn't declare subroutines with the same name as one of Perl's built-in functions or keywords. See perlfunc for a list of built-in functions; see perlsyn for keywords. sub open {} #not ok sub exit {} #not ok sub print {} #not ok sub foreach {} #not ok sub if {} #not ok #You get the idea... Exceptions are made for "BEGIN", "END", "INIT" and "CHECK" blocks, as well as "AUTOLOAD", "DESTROY", and "import" subroutines. CONFIGURATION
This Policy is not configurable except for the standard options. CAVEATS
It is reasonable to declare an object method with the same name as a Perl built-in function, since they are easily distinguished from each other. However, at this time, Perl::Critic cannot tell whether a subroutine is static or an object method. AUTHOR
Jeffrey Ryan Thalhammer <jeff@imaginative-software.com> COPYRIGHT
Copyright (c) 2005-2011 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. perl v5.16.3 2014-06-09 Perl::Critic::Policy::Subroutines::ProhibitBuiltinHomonyms(3)

Check Out this Related Man Page

Perl::Critic::Policy::BuiltinFunctions::RequireBlockGrepUser)Contributed Perl DocumenPerl::Critic::Policy::BuiltinFunctions::RequireBlockGrep(3pm)

NAME
Perl::Critic::Policy::BuiltinFunctions::RequireBlockGrep - Write "grep { $_ =~ /$pattern/ } @list" instead of "grep /$pattern/, @list". AFFILIATION
This Policy is part of the core Perl::Critic distribution. DESCRIPTION
The expression forms of "grep" and "map" are awkward and hard to read. 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. SEE ALSO
Perl::Critic::Policy::BuiltinFunctions::ProhibitStringyEval Perl::Critic::Policy::BuiltinFunctions::RequireBlockMap AUTHOR
Jeffrey Ryan Thalhammer <jeff@imaginative-software.com> COPYRIGHT
Copyright (c) 2005-2011 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. perl v5.14.2 2012-06-07 Perl::Critic::Policy::BuiltinFunctions::RequireBlockGrep(3pm)
Man Page

5 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

can unix program declare int?

can unix program declare int??how to declare ? if i want to declare int and using read command then compare which int is small...how to do this??can somebody help me? (1 Reply)
Discussion started by: yeah016
1 Replies

2. Shell Programming and Scripting

Passing arguments to Perl Function

Hi All, I am trying to pass an argument called "Pricelist" to a Perl function, then the function will open and print out the contents of the file named "Pricelist". But i can't seem to do it using my below code. Can any expert give some advice? #!/usr/local/bin/perl $DATABASE =... (1 Reply)
Discussion started by: Raynon
1 Replies

3. Shell Programming and Scripting

Array declaration in Shell script

this is my code declare -a USERCERT declare -a CACERT declare -a KEYSRC this is the error + declare -a USERCERT ./clone.sh: 1: declare: not found + declare -a CACERT ./clone.sh: 1: declare: not found + declare -a KEYSRC ./clone.sh: 1: declare: not found (11 Replies)
Discussion started by: xerox
11 Replies

4. Shell Programming and Scripting

Report printing

Hi. i am trying to print the contents of my text file with delimiter : separating them. 6:15:ABC ABD:ABB ABE: 2:20:AEE ABH:ACC AAA: i have completed my header for the report but i am having problem with my contents. i am trying to read in the data with the code below. { while read... (10 Replies)
Discussion started by: One_2_three
10 Replies

5. Shell Programming and Scripting

Bash to sh conversion

declare -i DEFINT=1 declare -i DEFDELAY=1 declare -i timeout=DEFTOUT declare -i interval=DEFINT declare -i delay=DEFDELAY if (($# == 0 || interval <= 0)); then printUsage exit 1 fi ( ((t = timeout)) while ((t > 0)); do sleep $interval kill -0 $$ ||... (5 Replies)
Discussion started by: SkySmart
5 Replies