Adding a bare block is a common technique to scope tighter. I don't understand the question really. The point of having the my inside the if block is so that $bar won't be visible outside of the block. Do you want another my-like keyword that makes a variable exist only "below", regardless of scope?
Is your question specifically about this kind of if blocks? If you, so you perhaps what to look at the ternary ?: operator which is an blockless if-else.
ihb
Read argumentation in its context!
In reply to Re: A cleaner way of scoping variables
by ihb
in thread A cleaner way of scoping variables
by bradcathey
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |