Re: OO confusion
- From: rob.dixon@xxxxxxx (Rob Dixon)
- Date: Sun, 11 Jan 2009 19:12:02 +0000
Randal L. Schwartz wrote:
"Rob" == Rob Dixon <rob.dixon@xxxxxxx> writes:
Rob> But the first causes Perl to keep two copies of the file data, which may be
Rob> unacceptable depending on the the size of the file and the specification of the
Rob> platform.
Does it really? Have you tested this?
I suspect it actually doesn't.
OK, I have just tested
open my $fh, '<:raw', $file or die $!;
followed by
my $data = do {
local $/;
<$fh>;
};
versus
my $data;
{
local $/;
<$fh>;
}
Where $file is a gash 512MB file.
The first results in a 1GB process whereas the second stops at 512MB or so. The
first also takes longer to read the file.
This is using ActiveState Perl v5.8.8 on Windows XP SP3.
Rob
.
- References:
- OO confusion
- From: Root
- Re: OO confusion
- From: Chas. Owens
- Re: OO confusion
- From: Mike McClain
- Re: OO confusion
- From: "Jenda Krynicky"
- Re: OO confusion
- From: "Dr.Ruud"
- Re: OO confusion
- From: Randal L. Schwartz
- Re: OO confusion
- From: Rob Dixon
- Re: OO confusion
- From: Randal L. Schwartz
- OO confusion
- Prev by Date: Re: OO confusion
- Next by Date: Re: OO confusion
- Previous by thread: 答复: OO confusion
- Next by thread: Re: OO confusion
- Index(es):
Relevant Pages
|