String::Cushion - Vertically pad a string
Version 1.0000, released 2020-04-30.
use String::Cushion; sub out { print cushion 2, 3, q{ A short text }; } # is exactly the same as sub out { print q{ A short text. }; }
String::Cushion provides cushion, a simple function that removes all leading and trailing lines and lines only consisting of white space or line breaks, and then adds a specified number of leading and trailing new lines (\n).
cushion
\n
# "\n hello\n" my $string = cushion 1, q{ hello };
# "\n hello\n\n" my $string = cushion 1, 2, q{ hello };
String::Stomp
String::Nudge
https://github.com/Csson/p5-String-Cushion
https://metacpan.org/release/String-Cushion
Erik Carlsson <info@code301.com>
This software is copyright (c) 2016 by Erik Carlsson.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install String::Cushion, copy and paste the appropriate command in to your terminal.
cpanm
cpanm String::Cushion
CPAN shell
perl -MCPAN -e shell install String::Cushion
For more information on module installation, please visit the detailed CPAN module installation guide.