I'm trying to learn perl, I have this code:
This enters an infinite loop and the output is%some_hash = ("foo", 35, "bar", 12.4, 2.5, "hello", "wilma", 1.72e30, +"betty", "bye\n"); while ( ($key, $value) = each %some_hash ) { print("number". $s++); print "$key => $value\n"; }
number0betty => bye number1betty => bye number2betty => bye number3betty => bye number4betty => bye . . .
Am I missing something here? I was expecting the loop to print out every element in the hash, but it doesn't. Any help appreciated.
I just discovered that it happens in my debugger only. I have an ubuntu installation with perl, eclipse and epic plugings. I have the padwalker installed. When I step in to the loop, it results in infinite loop. When directly run, it works fine as expected.
I have come up with so many problems, i'll almost give up on perl. This is really frustrating. I spent a week setting up the box and getting perl running with the debugger, now this...
In reply to Infinite loop with each by Kursad
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |