Randal L. Schwartz wrote:
>>>>>> ""Dr" == "Dr Ruud" <rvtol> writes:
> 
> "Dr> is better written as
> 
> ... for varying and arguable values of "better".
> 
> I prefer the "do" form, myself.

I too much prefer the style of

  my $data = do {
    local $/;
    <DATA>;
  };

over

  my $data;
  {
    local $/;
    $data = <DATA>;
  }

But the first causes Perl to keep two copies of the file data, which may be
unacceptable depending on the the size of the file and the specification of the
platform.

It is comparable to the efficiency of

  while (<DATA>) {
    :
  }

over

  foreach (<DATA>) {
    :
  }


Rob

-- 
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