in reply to Re^2: Unable to declare local variable with "use strict".
in thread Unable to declare local variable with "use strict".
So, I can not use local with use strict?
I just gave two examples that use local and strict.
I don't feel safe to use because there is no scope for it.
Local only works on package (global) variables. You can't use local on lexical (scoped) variables.
(Well, it also works hash elements and array elements, but I don't see how that could be useful here.)
Is it safe to use our with threads?
In Perl threads, each thread has its own variables unless you share them explicitly. This applies to both lexical (scoped) and package (global) variables.
|
|---|