in reply to Local Vs...
It depends. In the first case you used a lower-case x and in the second, you used an upper case X. They are not the same. Did you mean to do that?
Assuming you meant those to be the same, the answer is that you do not have to delclare my on the second line. You have to define @x with my to tell perl that you are using lexical scoping. When you do something with $x[0], it already knows what scope it is in.
|
|---|