perl::critic::policy::valuesandexpressions::restrictlongstrings(3) [centos man page]
Perl::Critic::Policy::ValuesAndExpressions::RestrictLongUsernContributed Perl DoPerl::Critic::Policy::ValuesAndExpressions::RestrictLongStrings(3)NAME
Perl::Critic::Policy::ValuesAndExpressions::RestrictLongStrings - Stop mixing long strings with code.
AFFILIATION
This policy is part of Perl::Critic::More, a bleeding edge supplement to Perl::Critic.
DESCRIPTION
Long text strings in the middle of code is very distracting and wreaks havoc on code formatting. Consider putting long strings in external
data files, "__DATA__" sections, or in their own subroutines.
This policy complains if a long string is not the last line of a subroutine. "Long" is defined as 78 characters by default. This value
can be altered in your Perl::Critic configuration via the "max_length" property. For example, you may add the following to your
.perlcriticrc file:
[ValuesAndExpressions::RestrictLongStrings]
max_length = 50
SEE ALSO AUTHOR
Chris Dolan <cdolan@cpan.org>
COPYRIGHT
Copyright (c) 2006-2008 Chris Dolan
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-10 Perl::Critic::Policy::ValuesAndExpressions::RestrictLongStrings(3)
Check Out this Related Man Page
Perl::Critic::Policy::ValuesAndExpressions::ProhibitEmptUsertContributed Perl DoPerl::Critic::Policy::ValuesAndExpressions::ProhibitEmptyQuotes(3)NAME
Perl::Critic::Policy::ValuesAndExpressions::ProhibitEmptyQuotes - Write "q{}" instead of "''".
AFFILIATION
This Policy is part of the core Perl::Critic distribution.
DESCRIPTION
Don't use quotes for an empty string or any string that is pure whitespace. Instead, use "q{}" to improve legibility. Better still,
created named values like this. Use the "x" operator to repeat characters.
$message = ''; #not ok
$message = ""; #not ok
$message = " "; #not ok
$message = q{}; #better
$message = q{ } #better
$EMPTY = q{};
$message = $EMPTY; #best
$SPACE = q{ };
$message = $SPACE x 5; #best
CONFIGURATION
This Policy is not configurable except for the standard options.
SEE ALSO
Perl::Critic::Policy::ValuesAndExpressions::ProhibitNoisyStrings
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::ValuesAndExpressions::ProhibitEmptyQuotes(3)
I'm trying to make this long line of codes in Perl looks nice by dividing it into 2 lines...
Before:
`echo "blahblahblahblahblahblahblahblahblahblahblah" > ~/lalala/lalala/lalala/lalala/lalala/abc`;
After:
`echo "blahblahblahblahblahblahblahblahblahblahblah" >
... (5 Replies)
How do you store strings in a variable-sized array?
Background:
I wrote a program earlier today to work with a very large text file. I chose Perl because it lets me do some nice formatting on the text I grab, instead of just using a shell script to con'cat'enate egrep results.
The program... (2 Replies)
Well, I found myself trying to fix some Perl code (Ive never done any Perl in my life) and I pinpointed the place where the bug could be. But to be sure I have to know what does a few line of code mean:
$files_lim =~ (/^\d*$/)
$files_lim =~ (/^\d*h$/)$files_age =~ s/h//The code where this was... (0 Replies)
Well, I found myself trying to fix some Perl code (Ive never done any Perl in my life) and I pinpointed the place where the bug could be. But to be sure I have to know what does a few line of code mean:
$files_lim =~ (/^\d*$/)
$files_lim =~ (/^\d*h$/)
$files_age =~ s/h//
The code where... (2 Replies)
Hi,
We've been using a perl script to extract datas from several logs to generate a report. I've been asked to rewrite the code in C++. I want to know if it is wise to have a code in C++ and will it be more faster than Perl? (23 Replies)
Hi Perl Experts,
I am new to Perl programming.
can somebody please help me in writing Perl code for following "find and replace logic".
i wanted to find following line in list of files in a given directory.
================================================
for(i=0;i <... (2 Replies)
Helooo,
So I have a .fasta file (a text file with sequence data) which looks like this, with just over 3 million lines of data.
>TCONS_00000001 gene=XLOC_000001
AATTGTGGTGAAATGACTTCTGTTAACGGAGACATCGATGATTGTTGTTACTATTTGTTCTCAGGATTCA... (8 Replies)