in reply to for loop error

satzbu:

You might want to try reading perlsyn so you can review the syntax of the for and foreach statement. Because you omitted the (necessary) parenthesis, perl doesn't want to compile your program. Of course, when you fix that one, it'll then whine about your usage of $xhash in the same line. You want that line to read:

foreach (keys(%xhash)) {

...roboticus