Chas. Owens wrote:

my $xml = do {
 open my $fh, "<", $filename
  or die "could not open $filename: $!";
 local $/;
 <$fh>;
};

I would write that as

  my $xml;
  {   open my $fh, "<", $filename
        or die "could not open $filename: $!";
      local $/;
      $xml= <$fh>;
  }

because it puts the file contents in application memory only once.

--
Ruud

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