in reply to Should "use strict" complain if I use a variable that is not declared?
The person who was talking about "initialized" versus "declared" was factually incorrect. Please look carefully at the code, and the results.
The variable is NOT being "my'ed" - and the result is that you get a local variable with the same behavior as a *global* (%x is only being "declared" once, and a reference to x returns the same address). Incredible that two "seemingly" locally scoped variables can have the same reference!
This is broken, plain and simple. my should have precedence. if someone say my $x = 1 if $y ... $x should be 1. declared and either "1" or "undefined". Not "global". That's wonky.
|
---|