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.2Perl::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.2Perl::Critic::Policy::ValuesAndExpressions::ProhibitMixedBooleanOperators(3pm)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)