develooper Front page | perl.perl6.language | Postings from February 2001

Re: JWZ on s/Java/Perl/

Thread Previous | Thread Next
Bart Lateur
February 11, 2001 02:34
Re: JWZ on s/Java/Perl/
Message ID:
On Fri, 9 Feb 2001 16:14:34 -0800, Mark Koopman wrote:

>but is this an example of the way people SHOULD code, or simply are ABLE to 
>code this.   are we considering to deprecate this type of bad style, and force
>to a programmer to, in this case, supply a ref to %baz in the arguements to
>this sub?

I think you're trying too hard turning Perl into just another C clone.
Dynamic variable allocation and freeing, like this, are one of the main
selling points for Perl as a language.

Note that %baz can, as values, also contain references to other
lexically scoped varibles, like \$foo and \$bar. No prototping around

>> 	sub test {
>> 	    my($foo, $bar, %baz);
>> 	    ...
>> 	    return \%baz;
>> 	}

You could, theoretically, create special versions of "my", or a "my"
with an attribute, so that these declared variables are kept out of the
normal lexical pool, and garbage collected in a more elaborate way,
perhaps even reference counting.


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About