Hi folks,
Can somebody explain the differences between declaring variables as "my", "local" or "global"? I've scanned the Perl docs and I understand the basics of it, but not the intracacies (the Perl docs are a bit over my head!). For a start I don't see "global" in perlfunc.
For example, if you declare a global at the start of your script, does that mean it's locked to that value, or that you can't use it as a local variable?
And are "my" and "local" the same, or is there a minor difference.
And what are the advantages/disadvantages of using them?
And, and...
You get the idea. Could anybody give me a basic rundown on them?
Cheers,
adam
Can somebody explain the differences between declaring variables as "my", "local" or "global"? I've scanned the Perl docs and I understand the basics of it, but not the intracacies (the Perl docs are a bit over my head!). For a start I don't see "global" in perlfunc.
For example, if you declare a global at the start of your script, does that mean it's locked to that value, or that you can't use it as a local variable?
And are "my" and "local" the same, or is there a minor difference.
And what are the advantages/disadvantages of using them?
And, and...
You get the idea. Could anybody give me a basic rundown on them?
Cheers,
adam