Thread In einem String Zeilenumbruch setzen (5 answers)
Opened by Sascha2018 at 2017-09-04 10:39

renee
 2017-09-04 10:53
#187333 #187333
User since
2003-08-04
14371 Artikel
ModeratorIn
[Homepage] [default_avatar]
Welche Version hast Du?

Bei mir sieht das so aus:
Code (perl): (dl )
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;


mit der Ausgabe
Code: (dl )
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 ?
$


Code: (dl )
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.
$
OTRS-Erweiterungen (http://feature-addons.de/)
Frankfurt Perlmongers (http://frankfurt.pm/)
--

Unterlagen OTRS-Workshop 2012: http://otrs.perl-services.de/workshop.html
Perl-Entwicklung: http://perl-services.de/

View full thread In einem String Zeilenumbruch setzen