in reply to Re^5: why doesn't "my ($a,$b)" return a list?
in thread why doesn't "my ($a,$b)" return a list?

> What language are you talking about? C, C++, Java, JavaScript and VB all require local declarations.

The direct competitors, Python and Ruby, but with the restriction of function-scope instead of block-scope. And PHP ¹)

JS is very strange in this respect, requiring explicit declarations with "var" but only allowing function-scope.

Newer JS (Mozilla) Versions have "let" which corresponds to "my" in Perl.

> More precisely, my LIST with a list of more than one variables.

exactly!

Cheers Rolf

1) updated

  • Comment on Re^6: why doesn't "my ($a,$b)" return a list?