develooper Front page | perl.perl5.porters | Postings from July 2004

Re: optimizing Short circuiting sort method based on [M]

Thread Previous | Thread Next
Paul Fenwick
July 21, 2004 18:10
Re: optimizing Short circuiting sort method based on [M]
Message ID:
G'day David / P5P,

david nicol wrote:

>>Eh? what would wantarray return a ref to in
>>    sub f { wantarray() ... }
>>    ($a, $b, @c) = f();
> an array of aliases to $a, $b, and $c:
>       [${\$a},${\$b},${\$c}]

So what do we do in the case of:

	print f();

wantarray() should clearly by true, but there are no variables that we 
can alias.

This could be worked around by creating an alias to a transient 
anonymous variable, which is then passed to print upon completion. 
However I'm not sure if we can do that without losing performance.



Paul Fenwick <> |
Director of Training                   | Ph:  +61 3 9354 6001
Perl Training Australia                | Fax: +61 3 9354 2681

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