Fix syntax errors.

At one point `for qw(...) { ... }` was allowed syntax. Then it became deprecated and a syntax error. This updates that syntax to the supported version.