in reply to Re^4: Perl array declaring
in thread Perl array declaring
In Tobyink's example, there is only one global variable, $foo. Use of 'use warnings' would have warned about multiple declarations. Change every 'our' to 'my' and the warning changes to reflect new variables masking the old.
In your case, you also have multiple variables with the same name, but in different scopes. As you said, this is sometimes useful, but you should not think of it as multiple declarations of the same variable.
|
|---|