Revision d0810c42
Von Sven Schöling vor etwa 18 Jahren hinzugefügt
bin/mozilla/menu.pl | ||
---|---|---|
# than 20 chars and store it in an array.
|
||
# use this array later instead of the -ed label
|
||
@chunks = ();
|
||
my ($i,$l) =(-1, 20);
|
||
my ($i,$l) = (-1, 20);
|
||
map {
|
||
$l += length $_;
|
||
if ($l < 20) { $chunks[$i] .= " $_";
|
||
} else { $l =length $_; $chunks[++$i] = $_; }
|
||
if (($l += length $_) < 20) {
|
||
$chunks[$i] .= " $_";
|
||
} else {
|
||
$l = length $_;
|
||
$chunks[++$i] = $_;
|
||
}
|
||
} split / /, $label;
|
||
map { $chunks[$_] =~ s/ / / } 0..$#chunks;
|
||
map { s/ / / } @chunks;
|
||
# end multi line
|
||
|
||
$label =~ s/ / /g;
|
Auch abrufbar als: Unified diff
kleine codeverbesserungen