Leser: 1
|< 1 2 3 4 5 >| | 48 Einträge, 5 Seiten |
1
2
3
4
5
6
foreach my $ele (@array) {
print "$ele\n";
for my $key ( keys($ele) ) {
print "$ele{$key}\n";
}
}
1
2
3
4
5
6
7
8
foreach my$ele (@array) {
# print "$ele\n";
# Kannste weglassen
foreach my$ele2 (keys %$ele) {
print $ele->{$ele2},"\n";
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
foreach (@Zeilen){
if ($typ == 1 && /$dokuart\;$zahl1\;(\d+)/){
$zahl1 = $1;
open(DATEI, "<C:/Beispieldaten/Konfigurationsdaten/20060310.REPOSITORY") || die "Datei nicht gefunden";
my @Zeilen = <DATEI>;
close(DATEI);
foreach(@Zeilen){
if(/^$zahl1;([^;]+)/){
$header = $1;
#print "$header\n";
}
}
$hash{$header} = $inhalt;
push(@array,\%hash);
}
}
}
foreach my$ele (@array) {
foreach my$ele2 (keys %$ele) {
print $ele->{$ele2},"\n";
}
}
push(@array, [ %hash ] );
[CODE]-Tags.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
foreach (@Zeilen){
if ($typ == 1 && /$dokuart\;$zahl1\;(\d+)/){
$zahl1 = $1;
open(DATEI, "<C:/Beispieldaten/Konfigurationsdaten/20060310.REPOSITORY") || die "Datei nicht gefunden";
my @Zeilen = <DATEI>;
close(DATEI);
foreach(@Zeilen){
my %hash;
if(/^$zahl1;([^;]+)/){
$header = $1;
$hash{$header} = $inhalt;
push(@array,\%hash);
#print "$header\n";
}
}
}
}
}
foreach my$ele (@array) {
# print "$ele\n";
# Kannste weglassen
foreach my$ele2 (keys %$ele) {
print $ele->{$ele2},"\n";
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
foreach (@Zeilen) { # woher kommen diese @Zeilen?
...
open(DATEI, '< ', 'C:/Beispieldaten/Konfigurationsdaten/20060310.REPOSITORY')
or die "Konnte Datei nicht öffnen: $!";
while (<DATEI>) {
if(/^$zahl1;([^;]+)/){
push(@array, [ $1, $inhalt ]); # Referenz auf anonymes Array mit $1 und $inhalt landet in @array
# woher kommt eigentlich $inhalt?
}
}
...
}
foreach my $element (@array) {
print "$element->[0] => $element->[1]\n";
}
1
2
3
4
5
6
7
8
9
10
11
12
13
open(DATEI, "<C:/Beispieldaten/Konfigurationsdaten/20060310.DOCFIELD") || die "Datei nicht gefunden";
my @Zeilen = <DATEI>;
close(DATEI);
foreach (@Zeilen){
if ($typ == 1 && /$dokuart\;$zahl1\;(\d+)/){
$zahl1 = $1;
open(DATEI, "<C:/Beispieldaten/Konfigurationsdaten/20060310.REPOSITORY") || die "Datei nicht gefunden";
my @Zeilen = <DATEI>;
close(DATEI);
foreach(@Zeilen){
my %hash;
if(/^$zahl1;([^;]+)/){
|< 1 2 3 4 5 >| | 48 Einträge, 5 Seiten |