Text::Wrap::Smart - Wrap text into chunks of (mostly) equal length


Text-Wrap-Smart documentation  | view source Contained in the Text-Wrap-Smart distribution.

Index


NAME

Top

Text::Wrap::Smart - Wrap text into chunks of (mostly) equal length

SYNOPSIS

Top

 use Text::Wrap::Smart qw(wrap_smart);

 $text = "..."; # random length

 # example options
 %options = (
             no_split => 1,
             max_msg_size => 160,
            );

 @chunks = wrap_smart($text, \%options);

DESCRIPTION

Top

Text::Wrap::Smart was primarly developed to split an overly long SMS message into chunks of mostly equal size. The distribution's wrap_smart() may nevertheless be suitable for other purposes.

FUNCTIONS

Top

wrap_smart

 @chunks = wrap_smart($text [, { options } ]);

options may contain the no_split option indicating that words shall not be broken up which indicates 'fuzzy wrapping` (if no_split is undefined, 'exact wrapping` will be applied). max_msg_size sets the character length boundary for each chunk emitted.

SEE ALSO

Top

Text::Wrap

AUTHOR

Top

Steven Schubiger <schubiger@cpan.org>

LICENSE

Top

This program is free software; you may redistribute it and/or modify it under the same terms as Perl itself.

See http://www.perl.com/perl/misc/Artistic.html


Text-Wrap-Smart documentation  | view source Contained in the Text-Wrap-Smart distribution.