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