Hi,

Is there a way to handle the error condition "out of memory" ?
This may occur when reading a whole file of unpredictable size.
Recovering control could allow to switch to a different method.
I've tried "warn", but it doesn't seem to work in this case.

open IN, "<blob";
$_ = do {local $/; <IN> or warn 'problem with IN'};
print length;
print '..exit..';

If the file is ok, it goes on printing the last two statements.
If the file is too big, it says "out of memory", and terminates.

Btw, if the script contains:

local $/; ($_ = <IN>) or warn 'problem with IN';

instead of the do statement earlier, one gets the diag:
# Value of <HANDLE> construct can be "0"; test with defined().

The script works anyhow, but I don't understand the diag. What <HANDLE> construct is 
to be tested and how ?

Thanks.

Reply via email to