Randal L. Schwartz wrote:
>>>>>> "Rob" == Rob Dixon <rob.di...@gmx.com> writes:
> 
> Rob> I tested the similar
> 
> Rob>   my @data = do {
> Rob>     open my $fh, '<', $file or die $!;
> Rob>     <$fh>;
> Rob>   };
> 
> Rob> a while ago, but not on v5.10. I will see if I can find time to try it 
> again.
> 
> Ahh, but that's very different.  My suspicion is that both the last-expr
> scalar of the block and the $result scalar will share the same single
> payload, similar to how:
> 
>          $x = $y
> 
> doesn't actually copy the *content*... just the scalar wrapper around
> the content.

It appears not, but there is certainly room for optimisation in the case where
scalar data both loses and gains a reference count at the end of a block like 
this.

R

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to