Variables defined in Perl are global by default.
1) My function: limits the name and value of a variable to a certain range. That is to say, the variable can only be a module or function at the current layer.
You can see that this variable is invisible at the upper or lower layers.
2) Our: to limit the variable name to a certain range, it is actually to explicitly declare a "global variable", although it is in
It is defined in the module or function and can be accessed outside the module. If it has been declared, use our again to indicate the our variables used here and previously declared
Is the same.
3) Local: The value is limited to a certain range. What makes the range different from my is that it contains the lower layer of the current layer and the lower layer of the current layer,
However, the upper layer of this layer cannot be accessed.
4) global variables
Use vars QW ($ szversioncode, $ szversionnmae) to define the variables $ szversioncode and $ szversionname
Global variable. Its role is equivalent to that of our. Because it appears after my and our appears before a period of time, you can
We can see that the definition of global variables in some books continues this definition method, but I suggest that you use the our keyword to define global variables.
PS: When Perl does not use strict 'vars', we can use variables without implementation.