in reply to Re^3: Scope and references
in thread Scope and references

So here was my misconception:
I thought that the scope of a for loop was
foreach (@a) { |<==From HERE to HERE==>| }
and that you just bounced aroud INSIDE OF the brackets. But I guess every time you evaluated the control statement, you leave the brackets and you lose scope and re-enter it. I did read Coping with Scoping, and that deals with this exact situation.
{}think; #Think outside of the brackets

Replies are listed 'Best First'.
Re^5: Scope and references
by Anonymous Monk on Jun 23, 2011 at 13:05 UTC
    Hello {}think
    $ perl -e " {}think; #Think outside of the brackets " Bareword found where operator expected at -e line 1, near "}think" (Missing operator before think?) syntax error at -e line 1, near "}think" Execution of -e aborted due to compilation errors.
    Nice try :)