Leser: 1
|< 1 2 3 4 >| | 33 Einträge, 4 Seiten |
1
2
3
4
5
my $FORMATSTRING = "format OUTPUT = \n" .
('@' . '<' x $maxLen . " ") x $values .
"\n" .
'$values ' x $values .
"\n.\n";
1
2
3
4
5
6
my $n = 3;
my $counter = 1;
for(split(/\n/,$values)){
print $_, $counter % $n == 0 ? "\n" : "\t";
$counter++;
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# Beispiel-Code
my $x = "v1\nv2\nv3\n";
my %vars;
my $varstring = '';
foreach ( split( /\n/, $x ) ) {
$vars{$_} = $_;
$varstring .= '$vars{' . $_ . '},';
}
chop($varstring); # letztes Komma entfernen
my $FORMATSTRING = "format OUTPUT = \n" .
('@' . '<' x $maxLen . " ") x $values .
"\n" .
$varstring .
"\n.\n";
eval($FORMATSTRING);
|< 1 2 3 4 >| | 33 Einträge, 4 Seiten |