Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

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::ProhibitImplUserNContributed PePerl::Critic::Policy::ValuesAndExpressions::ProhibitImplicitNewlines(3)

NAME
Perl::Critic::Policy::ValuesAndExpressions::ProhibitImplicitNewlines - Use concatenation or HEREDOCs instead of literal line breaks in strings. AFFILIATION
This Policy is part of the core Perl::Critic distribution. DESCRIPTION
Strings with embedded line breaks are hard to read. Use concatenation or HEREDOCs instead. my $foo = "Line one is quite long Line two"; # Bad my $foo = "Line one is quite long Line two"; # Better, but still hard to read my $foo = "Line one is quite long " . "Line two"; # Better still my $foo = <<'EOF'; # Use heredoc for longer passages Line one is quite long Line two Line three breaks the camel's back EOF CONFIGURATION
This Policy is not configurable except for the standard options. 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. Many 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-06Perl::Critic::Policy::ValuesAndExpressions::ProhibitImplicitNewlines(3)
Man Page

7 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Perl - How do you break the long line of codes into 2?

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)
Discussion started by: teiji
5 Replies

2. Shell Programming and Scripting

Perl: varible-sized arrays?

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)
Discussion started by: CRGreathouse
2 Replies

3. Shell Programming and Scripting

Help understanding Perl code.

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)
Discussion started by: RedSpyder
0 Replies

4. Shell Programming and Scripting

Help understanding some Perl code.

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)
Discussion started by: RedSpyder
2 Replies

5. Programming

Switching over to C++

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)
Discussion started by: Ribosome
23 Replies

6. Shell Programming and Scripting

Perl code request

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)
Discussion started by: chettyravi
2 Replies

7. Shell Programming and Scripting

Extracting and copying text from one file to another

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)
Discussion started by: 4galaxy7
8 Replies