my $text = "Haaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaalo\nWie geht es dir heute so ?";
1
2
3
$Text::Wrap::columns=250;
$Text::Wrap::break='[\s+]';
$message=wrap('','<br>', $message);
1 2 3 4 5 6 7 8 9 10 11 12 13
use v5.10; use strict; use warnings; use Text::Wrap; my $text = "Haaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaalo\nWie geht es dir heute so ?"; $Text::Wrap::columns=10; $Text::Wrap::break='[\s+]'; my $message=wrap('','<br>', $text); say $message;
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
$ perl community/wrap.pl
Haaaaaaaa
<br>aaaaa
<br>aaaaa
<br>aaaaa
<br>aaaaa
<br>aaaaa
<br>aaaaa
<br>aalo
<br>Wie
<br>geht
<br>es
<br>dir
<br>heute
<br>so ?
$
1
2
3
4
$ perl -MText::Wrap\ 99999999999999 -e 1
Text::Wrap version 2147483647 required--this is only version 2013.0523.
BEGIN failed--compilation aborted.
$
$Text::Wrap::break='[\s+]';