[ale] OT: Perl and VERY large files

attriel attriel at d20boards.net
Wed Aug 6 19:07:14 EDT 2003


> Hello,
>     I'm dabbling in perl at work and really like it so far.  I've
> written several scripts lately.  One I need to finish involves opening a
> file ~17 GB.  perl balks giving the following error.
>
> 'Value too large for defined data type at <name of script> line <number>'

Could you show us the line(s) of code around this ?

The error looks more like it's trying to READ the file in, not just open
it ...

Is it using some object/datatype?  AFAIK "open(FILE, "<filename");" just
allocates a file handle to reference the file and isn't reading the file
(and thus shouldn't overly CARE how big the file is, but I'll stipulate
that there might be something that does quick checks)

OTOH, if something is then doing "@lines = <FILE>;", that's gonna blow up
fast, since 17G of file probably has a few lines ;o  (and I think slurpy
file reading like that reads the whole file into memory and then splits,
which could be causing more problems)

--attriel
_______________________________________________
Ale mailing list
Ale at ale.org
http://www.ale.org/mailman/listinfo/ale





More information about the Ale mailing list