develooper Front page | perl.perl5.porters | Postings from March 2000

read(FH,$buffer,2**31 - 1)

Jeff Pinyan
March 15, 2000 15:50
read(FH,$buffer,2**31 - 1)
Message ID:
Hmm.  Why doesn't Perl like reading a lot from STDIN?

  perl -Mdiagnostics -e 'read(FOO,$FOO,2 ** 31 - 1)'

runs smoothly.

  perl -Mdiagnostics -e 'read(STDIN,$STDIN,2 ** 31 - 1)'

Out of memory during "large" request for -2147479552 bytes at -e line 1

    (F) The malloc() function returned 0, indicating there was insufficient
    remaining memory (or virtual memory) to satisfy the request. However,
    the request was judged large enough (compile-time default is 64K), so
    a possibility to shut down by trapping this error is granted.

MIDN 4/C PINYAN, NROTCURPI, US Naval Reserve           
PerlMonth - An Online Perl Magazine  
The Perl Archive - Articles, Forums, etc. Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About