Strange parsing error: sub x { } while 0 { my $b = 1; }
breaks: [[[ Statement not terminated properly at line 6, near "{\n my $" ]]] If I add a semicolon after to sub decl, then it's happy: sub x { }; ## <--- semicolon here! while 0 { my $b = 1; } The strange thing is that it's only happenning for "my" decls in the loop. If I declare the variable earlier, then I can assign it without problems.