[Israel.pm] content of big file on windows

Offer Kaye oferk at oren.co.il
Tue Mar 16 23:06:22 PST 2004


> What is the meaning of the "magical number" 1048576?

1048576 bytes = 1MB
No magic, no particular reason why I chose 1MB.

> If this is ment to be a very very large size of file in
> bytes, wouldn't it be better to use the -s file test unary
> operator to return the actual size of the file?
>

Yes, you could probably use some smart algorithm to select this parameter,
perhaps based on the input file size and available RAM, but I'm not sure
what benefit, if any, you would gain in terms of speed. Even for the 200MB
file this part of the script ran very fast, the main slowdown was in the
second part.

----------------------------------
Offer Kaye




More information about the Perl mailing list