Hi Monks
Me again ;-) Again thanks to all for their help on my syslog project I think I am now self sustaining and have a better understanding of Hashes etc. I do have one interesting bug probably a simple explanation for the guru's:
I have a simple hash but the last element will not print out unless I put "{why} on the end of it. If I don't put it on or take the "keys" of the last loop the print out just gives me back the hash ref = A B HASH(0x22501c) . Can some one please tell me how to do this properly as I don't think code with bugs is safe code and I might end up with bug ridden results - here is my example:
#c:\perl\bin\perl my %line; $why = ""; $a = A; $b = B; $c = C; $line{$a}{$b}{$c}; $i = 1; for $a (keys %line) { for $b (keys %{$line{$a}}) { for $c (keys %{$line{$a}{$b}}) { print "$a $b $c\n"; } } }
Thanks very much
Pierre
In reply to Hash code bug by Secode
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |