Leser: 1
![]() |
|< 1 2 3 4 5 >| | ![]() |
48 Einträge, 5 Seiten |
1
2
3
4
5
6
7
8
9
10
while (...) {
...
$hash{$header} = $inhalt;
push @keys, $header;
...
}
...
for my $key (@keys) {
print "$key => $hash{$key}\n";
}
1
2
3
4
5
6
7
8
9
10
11
my $cnt = 0;
while (...) {
...
$hash{$header} = [$cnt, $inhalt];
++$cnt;
...
}
...
for my $key (sort { $hash{$a}[0] <=> $hash{$b}[0] } keys %hash) {
print "$key => $hash{$key}[1]\n";
}
Quote2.Also was ich nicht verstehe ist wieso ich dass dann per referenz übergeben muss.
1
2
3
4
5
6
7
8
9
10
11
%hash = (
abc => "Alphabet",
123 => "Ein-mal-eins");
push(@array,%hash);
# @array:
# 0 : abc
# 1 : Alphabet
# 2 : 123
# 3 : Ein-mal-eins
1
2
3
4
5
6
SortByKey
Reorders the IxHash elements by textual comparison of the keys.
SortByValue
Reorders the IxHash elements by textual comparison of the values.
![]() |
|< 1 2 3 4 5 >| | ![]() |
48 Einträge, 5 Seiten |