in reply to Placement of "my"

Thanks everybody.

I had this impression that if it's declared inside the loop, it's duplicative because the declaration happens iteratively over the duration of the loop.

The scope part didn't come to mind.

Replies are listed 'Best First'.
Re^2: Placement of "my"
by JavaFan (Canon) on Apr 02, 2009 at 15:48 UTC
    Declaration is a compile-time thing. So, it happens once. Even if you don't execute the loop.
      Ah thanks for that. It's an enlightenment to me.