As for 5), the answer is, "it's not really a sensible question". Global variables have to do with scope - a variable is global if it can be accessed from the outer scope. Lexical (my) can, if declared appropriately. Package variables always can (obviously), but they don't need to be declared - from a language point of view, they always exist. "use vars" is just a way of telling Perl "in this scope, I'm going to use these package variables, and I'm not going to refer to them by their full name" (use vars will have some effects in perl - but that's implementation, not language).
As for 6), there's no difference. But there is a difference between my($x, $y); and my $x, $y;. The former is equivalent to my $x; my $y;, the latter to my $x; $y;.
I do not understand question 7). Where is my $c?
8) you can just try out for yourself.
In reply to Re: Understanding difference between my and local variables.
by JavaFan
in thread Understanding difference between my and local variables.
by manishrathi
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |