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: [email protected]
For additional commands, e-mail: [email protected]
http://learn.perl.org/
