String::Truncate 0.100 review

Download
by rbytes.net on

String::Truncate is a Perl module for when strings are too long to be displayed in. SYNOPSIS This module handles the simple but

License: Perl Artistic License
File size: 5K
Developer: Ricardo Signes
0 stars award from rbytes.net

String::Truncate is a Perl module for when strings are too long to be displayed in.

SYNOPSIS

This module handles the simple but common problem of long strings and finite terminal width. It can convert:

"this is your brain" -> "this is your ..."
or "...is your brain"
or "this is... brain"
or "... is your b..."
It's simple:
use String::Truncate qw(elide);

my $brain = "this is your brain";

elide($brain, 16); # first option
elide($brain, 16, { truncate => 'left' }); # second option
elide($brain, 16, { truncate => 'middle' }); # third option
elide($brain, 16, { truncate => 'ends' }); # fourth option

String::Trunc::trunc($brain, 16); # => "this is your bra"

Requirements:
Perl

String::Truncate 0.100 keywords