thanks demerphq.
With your point in mind, its very clear that some part of my code is throwing "Not enough space" error message. Now how is that possible as there is enough memory availbel. No matter which part of the program sets it, its MY program only which is setting it. So even if I check for $! value at the end of the program, and it has an error value that signifies that the program generated that error while running ( though at that point the error may be invalid or in other words the error may have been generated at the line 1 itself and I am catching it at end of the program). So the question why/how this error "Not enough space" is possible in a system having so much memory and resources. For example:
@arr[some very high no which causes a memory exception] = 88;
# at this point $! is set to "Not enough memory"
#I do some work here
print "Hello world";
print "Hello world";
print "Hello world";
# here I check $! and $! is "Not enough memory" which means that the p
+rogram threw "Not enough memory" at some point in time during its exe
+cution before this point. And it just happens that no other system ca
+ll has generated any other error from the time "Not enough memory" wa
+s thrown. If the pevious array allocation didnt throw any error then
+$! here will be still unset or 0( thats what I expect, please correct
+ me if I am wrong).
if ($!)
{
# error
exit(0);
}
print "$arr[0]";
Or is it that the value of $! can be "Not enough space" even without my program causing a memory exception? Meaning $! can be a dangling one?
appreciate your thoughts.
Jayanta
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.