Perl::...Strings(3pm)

πŸ“¦
version 1.003 Β· 2 versions
, in fedora 43

πŸ’… NAME πŸ’…

Perl::Critic::Policy::ValuesAndExpressions::RestrictLongStrings β€” bestie, it's the policy that says stop mixing long strings with code, no cap 🫢


✨ AFFILIATION ✨

This policy is part of Perl::Critic::More, a bleeding edge supplement to Perl::Critic. iykyk πŸ’œ


🌸 DESCRIPTION 🌸

Okay so, imagine you're reading code and then suddenly there's a giant wall of text just sitting there in the middle of it. Not the vibe. Long text strings in the middle of code is very distracting and wreaks havoc on code formatting. 😭 So consider putting those long strings in external data files, in __DATA__ sections, or in their own subroutines. main character formatting energy only, periodt ✨

This policy complains if a long string is not the last line of a subroutine. And "long"? It's defined as 78 characters by default. But bestie you can alter that value 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

Obsessed. Slay. πŸŽ€


πŸ¦‹ TODO πŸ¦‹

Add option to allow long strings that don't include newlines. (It's giving "future plans", not "already done" β€” don't @ me 🌈)


πŸ‘‘ AUTHOR πŸ‘‘

Chris Dolan <cdolan@cpan.org>


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. πŸ“œ


and that's the whole page, bestie!! this one came from the Perl docs, perl v5.42.0, dated 2025-07-25, and yeah β€” same title, Perl::...Strings(3pm), we're just cuter about it now πŸ’…βœ¨πŸ«Ά

πŸ“¦ where this page comes from