http://qs321.pair.com?node_id=11101939


in reply to Braces around a section of code

There are many good reasons to do that, none of which apply here :P

It could be to limit the scope of a variable, eg to make sure that a filehandle is closed and destroyed when you are done using it. But there's no variable limited to the scope of that block. And it looks like the variables used or not lexical (my) anyway, since the loop variable which should be limited to the loop is not.

It could to separate the code logically, and make it easier to read. But here the indentation it very unhelpful so I doubt that this was a concern. Edit: the comment at the top might be to describe the whole block though?

A single block also works like a loop that is executed once. So the keywords redo (which goes back to the start of the block), next and last (both of which jump to the end of the block) can be used. But this is not the case here.

So my guess here would be that there used to be a condition or function which was removed, but not the corresponding block. Or some other unintentional reason.

Edit: ++Discipulus for mentioning local as well. There's also lexically scoped pragmas (like autodie) whose effect only applies inside the current block. But there's no use statement here, so that's still not the reason.