Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
Re: Braces around a section of codeby Athanasius (Archbishop) |
on Jun 26, 2019 at 13:30 UTC ( [id://11101938]=note: print w/replies, xml ) | Need Help?? |
Hello thnksnw, and welcome to the Monastery! Braces create a block, which has its own lexical scope. So you might do something like this:
to restrict the scope of $foo to only that part of the code where it ought to be used. In the code shown, I can’t see any advantage to the braces. Is this the real code? If so, maybe the author was intending to add an if above it to remove the code from execution or even from compilation. For example,
Hope that helps,
In Section
Seekers of Perl Wisdom
|
|