in reply to A cleaner way of scoping variables

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!

Replies are listed 'Best First'.
Re^2: A cleaner way of scoping variables
by bradcathey (Prior) on Aug 09, 2004 at 16:58 UTC
    Yes, my intent, magically and apparently erroneously, was to use it "below." I do use the ternary operator often, but my example, as alluded to by other responders, is really simplied and in reality goes beyond the range of the clever ternary approach.

    —Brad
    "Don't ever take a fence down until you know the reason it was put up. " G. K. Chesterton