Thread 3dimensionale hashes und die ausgabe (3 answers)
Opened by v0id at 2007-04-11 18:11

v0id
 2007-04-11 18:11
#75954 #75954
User since
2005-07-06
33 Artikel
BenutzerIn
[default_avatar]
Hallo zusammen,

ich hab wieder ein problem und seh den wald vor lauter bäumen gar nicht mehr.

ich habe ein hash of hashes das mit dem dumper auch richtig ausgegeben wird und ordentlich aussieht, wie folgt:

$VAR1 = {
'unwichtig' => {
'begin' => {
'name' => 'unwichtig',
'year' => 2006,
'minute' => 38,
'second' => 49,
'month' => '09',
'day' => 29,
'hour' => '02'
},
'end' => {
'name' => 'unwichtig',
'year' => 2007,
'minute' => 33,
'second' => 29,
'month' => '04',
'day' => 11,
'hour' => '02'
}
},
'nichts' => {
'begin' => {
'name' => 'nichts',
'year' => 2006,
'minute' => 50,
'second' => 36,
'month' => 10,
'day' => 26,
'hour' => '03'
},
'end' => {
'name' => 'nichts',
'year' => 2007,
'minute' => '07',
'second' => 19,
'month' => '04',
'day' => 10,
'hour' => 11
}
},
usw usw..

mein ausgabe foreach schaut so aus
Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
    40  foreach my $session (%dif_hash)
41 {
42
43 print $session . "\n";
44 #$x++;
45 #print "\n\n". $dif_hash{$session}{'begin'}{'name'};
46 #print " " . $dif_hash{$session}{'begin'}{'hour'};
47 #print "" . $dif_hash{$session}{'begin'}{'minute'};
48 #print "" . $dif_hash{$session}{'begin'}{'second'};
49 #print " " . $dif_hash{$session}{'begin'}{'day'};
50 #print "" . $dif_hash{$session}{'begin'}{'month'};
51 #print "" . $dif_hash{$session}{'begin'}{'year'};
52 #print "\n";
53 #print $dif_hash{$session}{'end'}{'name'};
54 #print " " . $dif_hash{$session}{'end'}{'hour'};
55 #print "" . $dif_hash{$session}{'end'}{'minute'};
56 #print "" . $dif_hash{$session}{'end'}{'second'};
57 #print " " . $dif_hash{$session}{'end'}{'day'};
58 #print "" . $dif_hash{$session}{'end'}{'month'};
59 #print "" . $dif_hash{$session}{'end'}{'year'};
60 #print "\n\n";
61
62 }
63


was is daran falsch? jede zweite session die ausgegeben wird sieht in etwa so aus HASH(0xa2c04)

es schaut im dumper doch alles in ordnung aus und die ausgabe funktioniert auch auf die weise :-/

ein verzweifelter gruß

v0id

View full thread 3dimensionale hashes und die ausgabe