in reply to Pass array, then clear
One difficulty inherent in the design of the Perl language is that there is no mandatory declaration in the syntax of the language of what parameters a function takes, and whether the parameter should be passed by-value or by-reference. The statement $a = 2; can work in several different ways, and exactly how it works is determined at runtime. In traditional languages, the compiler would generate different code depending on how a parameter is to be passed. In Perl, "reference" is a data-type. And there is really nothing to be done about it: that's just how this language works.
|