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

Re: JWZ on s/Java/Perl/

From:
Piers Cawley
Date:
February 10, 2001 17:52
Subject:
Re: JWZ on s/Java/Perl/
Message ID:
m3n1buj87n.fsf@iest.bofh.org.uk
Mark Koopman <mark@websidestory.com> writes:

> > On Fri, 09 Feb 2001 12:06:12 -0500, Ken Fox wrote:
> > 
> > 
> > That may work for C, but not for Perl.
> > 
> > 	sub test {
> > 	    my($foo, $bar, %baz);
> > 	    ...
> > 	    return \%baz;
> > 	}
> > 
> > You may notice that only PART of the locally malloced memory, gets
> > freed. the memory of %baz may well be in the middle of that pool. You're
> > making a huge mistake if you simply declare the whole block dead weight.
> > 
> > -- 
> > 	Bart.
> 
> 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?

Err, if this is declared 'bad style' how is one supposed to write an
object constructor?

-- 
Piers




nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About