Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

perl::critic::policy::variables::prohibitaugmentedassignmentinde(3pm) [debian man page]

Perl::Critic::Policy::Variables::ProhibitAugmentedAssignUserIContribPerl::Critic::Policy::Variables::ProhibitAugmentedAssignmentInDeclaration(3pm)

NAME
Perl::Critic::Policy::Variables::ProhibitAugmentedAssignmentInDeclaration - Do not write " my $foo .= 'bar'; ". AFFILIATION
This Policy is part of the core Perl::Critic distribution. DESCRIPTION
Variable declarations that also do initialization with '=' are common. Perl also allows you to use operators like '.=', '+=', etc., but it it is more clear to not do so. my $foo .= 'bar'; # same as my $foo = 'bar'; our $foo *= 2; # same as our $foo = 0; my ( $foo, $bar ) += ( 1, 2 ); # same as my ( $foo, $bar ) = ( undef, 2 ); local $Carp::CarpLevel += 1; # same as local $Carp::CarpLevel = 1; state $foo += 2; # adds 2 every time it's encountered Such constructs are usually the result of botched cut-and-paste, and often are bugs. Some produce warnings. CONFIGURATION
This Policy is not configurable except for the standard options. AUTHOR
Mike O'Regan COPYRIGHT
Copyright (c) 2011 Mike O'Regan. 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 Perl::Critic::Policy::Variables::ProhibitAugmentedAssignmentInDeclaration(3pm)

Check Out this Related Man Page

Perl::Critic::Policy::ValuesAndExpressions::ProhibitMixeUserlContribPerl::Critic::Policy::ValuesAndExpressions::ProhibitMixedBooleanOperators(3pm)

NAME
Perl::Critic::Policy::ValuesAndExpressions::ProhibitMixedBooleanOperators - Write " !$foo && $bar || $baz " instead of " not $foo && $bar or $baz". AFFILIATION
This Policy is part of the core Perl::Critic distribution. DESCRIPTION
Conway advises against combining the low-precedence booleans ( "and or not" ) with the high-precedence boolean operators ( "&& || !" ) in the same expression. Unless you fully understand the differences between the high and low-precedence operators, it is easy to misinterpret expressions that use both. And even if you do understand them, it is not always clear if the author actually intended it. next if not $foo || $bar; #not ok next if !$foo || $bar; #ok next if !( $foo || $bar ); #ok CONFIGURATION
This Policy is not configurable except for the standard options. 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 Perl::Critic::Policy::ValuesAndExpressions::ProhibitMixedBooleanOperators(3pm)
Man Page

15 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How can I make an if [ -f ] statement with wildcards?

Normally you would have something like.. if then foo bar fi but what if you wanted to do something like if then foo bar fi How do I get Unix to accept anything that matches a pattern of FILENAME with anything after it during an in if statement? (3 Replies)
Discussion started by: LordJezo
3 Replies

2. UNIX for Dummies Questions & Answers

Using Variables to Set Other Variables

I have a script that I'm trying to shorten (below) by removing repetitive code. if ] then commodity_ndm_done=Y fi if ] then customer_ndm_done=Y fi if ] then department_ndm_done=Y fi if ] then division_ndm_done=Y fi (3 Replies)
Discussion started by: superdelic
3 Replies

3. Shell Programming and Scripting

taking the end off a path

I need a script to be able to take a path such as "/foo/bar/thing" a put the "/foo/bar/" bit in one variable and the "thing" bit in another. I figured awk would probably be the best tool for the job but looking at the man page didn't seem to help. The only way i know how to use awk is with... (12 Replies)
Discussion started by: Nat
12 Replies

4. UNIX for Advanced & Expert Users

how does this work....

1|foo|bar 2|usa|ll 3|usa|vg 4|usa|vg 5|bar|vg 6|usa|vg 7|usa|ll 8|uk|nn 9|foo|manu|bar 10|uk|bb 11|foo|mm 12|kuwait|jkj 13|kuwait|mm 14|dubai|hh awk '/foo/,/bar/' test_file1----command run at the prompt output should have been the first 3 lines...... 1|foo|bar (1 Reply)
Discussion started by: bishweshwar
1 Replies

5. UNIX for Dummies Questions & Answers

Variables

i have a script i want that two varibles to be copied to another file. can anyone help me with this Thanks in advance Gina (3 Replies)
Discussion started by: gina
3 Replies

6. UNIX for Dummies Questions & Answers

Adding columns to a file

I want to select the first column from a daily file called foo.csv. The result is written to file foo.txt. Currently the following script is used for that: cut -d, -f 1 foo.csv > foo.txt A typical result would yield : A12 A45 B11 B67 What needs to happen in addition is that two columns... (5 Replies)
Discussion started by: figaro
5 Replies

7. UNIX for Dummies Questions & Answers

Question About Getting Line Numbers in a File

Ok, this is a unique question. Say I have a word like "jamamamama" in a file called foo.bar. Now, how do you get the line number that the word "jamammama" exist in the file foo.bar without having to go into the foo.bar file to edit it? is there a command i can run on the foo.bar... (4 Replies)
Discussion started by: SkySmart
4 Replies

8. Shell Programming and Scripting

Removing duplicates from string (not duplicate lines)

please help me in getting following: Input Desired output x="foo" foo x="foo foo" foo x="foo foo" foo x="foo abc foo" foo abc x="foo foo1 foo2" foo foo1 foo2 I need to remove duplicated from string.. (8 Replies)
Discussion started by: vickylife
8 Replies

9. Shell Programming and Scripting

KSH Output/Strip portion of file in HP-UX

I have a file, we'll call it file.txt. It has thousands of lines of all kinds of output at any given time (ie. foo bar foo bar) I need to copy out just a portion of the file from Point-A to Point-B. I'd like to save off just that portion to a file called test123xyz.txt. How do I do that? ... (7 Replies)
Discussion started by: austin881
7 Replies

10. Shell Programming and Scripting

Remove if the above line matches pattern

but keep if does not I have a file: --> my.out foo: bar foo: moo blarg i am on vacation foo: goose foo: lucy foo: moose foo: stucky groover@monkey.org foo: bozo grimace@gonzo.net dear sir - blargo blargo foo: goon foo: sloppy foo: saudi gimme gimme gimme (3 Replies)
Discussion started by: spacegoose
3 Replies

11. Shell Programming and Scripting

NR==FNR trick for joining columns from two files

foo.txt 1 rs2887286 0 1145994 C T 1 rs1240743 0 1323299 C A 1 rs1695824 0 1355433 G T 1 rs3766180 0 1468016 G A 1 rs7519837 0 1500664 A G 1 rs2272908 0 ... (12 Replies)
Discussion started by: genehunter
12 Replies

12. Shell Programming and Scripting

Awk Script for Personal Markup

input: ---- blablablabla foofoofooo nothing foo never never nothing foo ever forever foo bar foo moo bar moo status quo blablabla never foo moo bar moo blablabla pehh (2 Replies)
Discussion started by: uterwer
2 Replies

13. Shell Programming and Scripting

repetition calculation

cat mylist First_NAME Gender Mike M Sara F Raya M Sara F Fibi F Mike M Mike M Micheal M can someone please help me to get a script to cacluate the number of repetions for each (First name... (3 Replies)
Discussion started by: Sara_84
3 Replies

14. Shell Programming and Scripting

Loop through file and replace with sed

Hello all, I need some help please. I got file1 with names. foo bar foo bar foo bar foo bar foo bar and I got file2 with some text some text some text #KEYWORD some text some text some text (3 Replies)
Discussion started by: stinkefisch
3 Replies

15. Shell Programming and Scripting

Use of colon

There was a sample code on forum I found sometime back: $ f() { local foo=; : ${foo=unset}; declare -p foo; }; f declare -- foo="" $ f() { local foo; : ${foo=unset}; declare -p foo; }; f declare -- foo="unset" Can someone explain why was colon (:) is being used here. Whats its use? (4 Replies)
Discussion started by: Rameshck
4 Replies