String::Stomp - Removes empty leading and trailing lines
Version 0.0103, released 2017-12-31.
use String::Stomp; sub out { print stomp q{ A short text }; } # is exactly the same as sub out { print q{ A short text}; }
String::Stomp provides stomp, a simple function that removes all leading and trailing lines that only consist of white space or line breaks.
stomp
# ' hello' my $string = stomp q{ hello };
Syntax::Feature::Qs adds qs and qqs that removes all leading whitespace from all lines in a string:
qs
qqs
# these three packages are equivalent: package Example::Stomp { use String::Stomp; use syntax 'qs'; sub out { print stomp qs{ This is a multi line string. }; } } package Example::Q { sub out { print q{This is a multi line string.}; } } package Example::HereDoc { sub out { (my $text = <<" END") =~ s{^ {12}}{}gm; This is a multi line string. END $text =~ s{\v\z}{}; print $text; } }
String::Trim::More
String::Util
qi
https://github.com/Csson/p5-String-Stomp
https://metacpan.org/release/String-Stomp
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::Stomp, copy and paste the appropriate command in to your terminal.
cpanm
cpanm String::Stomp
CPAN shell
perl -MCPAN -e shell install String::Stomp
For more information on module installation, please visit the detailed CPAN module installation guide.