in reply to Braces around a section of code
As the others have already said, the blocks introduce a new scope, and there are quite a few things in Perl that are lexically scoped. Just to add some more to the list that haven't been mentioned yet: several pragmas, such as strict and warnings, are also lexically scoped, and there are a few (rare!) cases where one might want to temporarily disable parts of those pragmas for a very small block of code.
By the way, I would recommend properly indenting the inner blocks as well. perltidy can help.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Braces around a section of code
by Tux (Canon) on Jun 30, 2019 at 12:23 UTC | |
by haukex (Archbishop) on Jun 30, 2019 at 12:38 UTC |